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

# Ekspor Riwayat Skrining AML sebagai CSV API

> Unduh riwayat pemantauan AML berkelanjutan dari sesi sebagai file CSV, satu baris per skrining ulang yang selesai, siap diserahkan ke auditor.

Prompt API Ekspor Riwayat Skrining AML
Salin prompt ke papan klip

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

Tempel ke

File ini berisi skrining yang sama dengan [Daftar riwayat skrining AML](https://docs.didit.me/id/management-api/sessions/aml-screening-history.md), yang diratakan menjadi satu baris per skrining, dengan tanggal pembaruan dataset dari setiap kategori daftar (sanksi, PEP, peringatan, media negatif) jika dilaporkan. Business Console menawarkan ekspor yang sama di samping hasil AML. Lihat [Pemantauan AML Berkelanjutan](https://docs.didit.me/id/core-technology/aml-screening/continuous-monitoring-aml-screening.md) untuk arti setiap nilai.


## OpenAPI

````yaml id/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 Verifikasi Identitas. Lakukan autentikasi dengan header x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/aml-screening-history/export/:
    get:
      tags:
        - Sessions
      summary: Ekspor riwayat skrining AML sebagai CSV
      description: >-
        Unduh riwayat pemantauan berkelanjutan yang sama seperti `GET
        /v3/session/{sessionId}/aml-screening-history/` sebagai file CSV, satu
        baris per skrining ulang yang selesai, dari yang terbaru terlebih
        dahulu, siap diserahkan kepada auditor. File dialirkan secara utuh
        (tanpa paginasi) dan dimulai dengan baris header; sel kosong berarti
        tidak diketahui, tanggal dataset tidak pernah diestimasi, dan nilai yang
        akan memulai rumus spreadsheet diawali dengan tanda petik tunggal.
        Berfungsi untuk ID sesi KYC dan KYB; berikan `node_id` jika sesi
        menjalankan lebih dari satu langkah AML. Berikan `month` untuk
        mengekspor satu bulan kalender. Kesalahan dikembalikan sebagai JSON,
        bukan CSV. Kunci API dengan cakupan memerlukan `decisions: read` dan
        `media: read`: karena respons berupa file, kunci tanpa `media: read`
        akan menerima `403`.
      operationId: get_v3_session_aml_screening_history_export
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            UUID sesi verifikasi (`session_id` yang dikembalikan oleh `POST
            /v3/session/`). Menerima ID sesi Verifikasi Pengguna (KYC) dan
            Verifikasi Bisnis (KYB): server mencari ID tersebut di kedua jenis
            sesi. Harus berupa UUID dengan format yang benar; nilai yang salah
            format tidak cocok dengan rute dan mengembalikan HTML `404`.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: node_id
          in: query
          required: false
          description: >-
            ID node graf alur kerja dari pemeriksaan AML. Hanya diperlukan jika
            sesi menjalankan lebih dari satu langkah AML; jika tidak diisi,
            pemeriksaan AML terbaru yang akan digunakan. Node yang tidak dikenal
            akan mengembalikan `404`.
          schema:
            type: string
            example: feature_aml_1
        - name: month
          in: query
          required: false
          description: >-
            Bulan kalender UTC dalam format `YYYY-MM`. Hanya skrining yang
            selesai pada bulan tersebut yang dikembalikan; tanpa parameter ini,
            setiap bulan akan dikembalikan. Format bulan yang salah
            mengembalikan `400`.
          schema:
            type: string
            pattern: ^\d{4}-(0[1-9]|1[0-2])$
            example: 2026-09
      responses:
        '200':
          description: >-
            File CSV, dialirkan sebagai `text/csv` dengan pemisah baris CRLF.
            Kolom, secara berurutan: `screened_at` (saat skrining ulang
            selesai), `outcome` (`NO_CHANGE`, `CHANGED`, atau `FAILED`),
            `provider` (pengidentifikasi opak dari sumber data AML; jangan
            gunakan nilainya untuk menentukan percabangan), `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` (proses pemantauan),
            `entities_screened` (`1`, atau `0` untuk proses yang gagal) dan
            `new_hits` (kosong jika tidak diketahui). Format tanggal adalah ISO
            8601 dengan offset UTC. Sesi yang belum memiliki skrining ulang
            hanya mengembalikan baris header.
          headers:
            Content-Disposition:
              description: >-
                `attachment; filename="aml-screening-history-{sessionId}.csv"`,
                atau `aml-screening-history-{sessionId}-{month}.csv` ketika
                `month` diteruskan.
              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` bukan bulan kalender `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: >-
            Kunci API dengan cakupan terbatas telah kedaluwarsa. Ini
            satu-satunya kasus yang mengembalikan `401`: kunci yang hilang,
            tidak valid, atau dicabut mengembalikan `403`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Pesan kesalahan yang mudah dibaca manusia.
              examples:
                Expired key:
                  summary: Tanggal kedaluwarsa kunci telah lewat
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            Kegagalan autentikasi atau otorisasi. Kunci yang hilang
            mengembalikan `403`, begitu juga dengan kunci dari aplikasi lain,
            kunci dengan cakupan tanpa izin yang dibutuhkan endpoint ini, dan
            permintaan dari luar daftar izin IP kunci tersebut; kunci yang
            salah, dicabut, atau kedaluwarsa mengembalikan `401`. Bedakan
            kegagalan tersebut berdasarkan `detail`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Pesan kesalahan yang mudah dibaca manusia.
              examples:
                Missing or invalid credentials:
                  summary: Tidak ada header x-api-key, atau kunci gagal divalidasi
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Other application:
                  summary: Kunci valid milik aplikasi yang berbeda dari sesi
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without decisions read:
                  summary: 'Kunci ber-scope tidak memiliki decisions: read'
                  value:
                    detail: This API key has no read access to decisions.
                Scoped key without media read:
                  summary: >-
                    Kunci ber-scope tidak memiliki media: read (respons berupa
                    file)
                  value:
                    detail: This API key has no read access to media.
                IP not allowed:
                  summary: Permintaan dari luar daftar izin IP kunci
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            Sesi tidak ada, telah dihapus, atau berada di luar batas kunci
            dengan cakupan terbatas, atau tidak memiliki pemeriksaan AML (untuk
            `node_id` yang diberikan). Pencarian sesi berjalan sebelum
            pemeriksaan kredensial, sehingga `sessionId` yang tidak dikenal
            mengembalikan `404` bahkan tanpa kunci yang valid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Pesan kesalahan yang mudah dibaca manusia.
              examples:
                Unknown session:
                  summary: Tidak ada sesi dengan ID ini, atau telah dihapus
                  value:
                    detail: Not found.
                Outside key limits:
                  summary: >-
                    Sesi berada di luar batas kunci dengan cakupan terbatas
                    (juga dikembalikan untuk sesi yang baru saja dihapus)
                  value:
                    detail: Session not found.
                No AML check:
                  summary: Sesi tidak pernah menjalankan langkah AML
                  value:
                    detail: The session does not have an AML check.
                No AML check for node:
                  summary: >-
                    node_id tidak cocok dengan pemeriksaan AML pada sesi
                    tersebut
                  value:
                    detail: >-
                      The session does not have an AML check for node
                      'feature_aml_2'.
        '429':
          description: >-
            Batas laju terlampaui: 600 permintaan GET per menit per kunci API.
            Tunggu `Retry-After` detik sebelum mencoba lagi; header
            `X-RateLimit-*` menampilkan anggaran yang tersedia.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Pesan kesalahan yang mudah dibaca manusia.
              examples:
                Rate limited:
                  summary: Anggaran untuk menit saat ini habis
                  value:
                    detail: >-
                      GET request rate limit exceeded. You can make up to 600
                      requests per minute.
          headers:
            Retry-After:
              description: Detik untuk menunggu sebelum mencoba lagi.
              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: >-
        Kunci API aplikasi Anda, dari Developers -> API keys di Business
        Console. Kunci utama memiliki akses penuh. Kunci bernama dapat diberi
        cakupan: none, read, atau write per sumber daya, dibatasi pada beberapa
        alur kerja atau pada sesi yang disetujui, pada daftar alamat IP, dan
        pada tanggal kedaluwarsa. 401 berarti kuncinya salah, dicabut, atau
        kedaluwarsa; 403 berarti tidak ada kunci yang dikirimkan, kunci tidak
        memiliki akses ke sumber daya atau tindakan ini, atau permintaan datang
        dari alamat di luar daftar IP-nya; 404 pada rute sesi berarti sesi
        berada di luar alur kerja atau status kunci tersebut. Kunci tanpa akses
        media menerima URL gambar, video, dan PDF sebagai null, dan kunci tanpa
        izin tulis sesi menerima tautan sesi dan token sebagai null. Lihat
        https://docs.didit.me/console/api-keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.