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

> Didit APIで、セッションの継続的なAMLモニタリング履歴をCSVファイルとしてダウンロードできます。完了した再スクリーニングごとに1行で出力され、そのまま監査人に提出できます。

AMLスクリーニング履歴エクスポートAPIのプロンプト
プロンプトをクリップボードにコピー

<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/ja/management-api/sessions/aml-screening-history.md)と同じスクリーニングが1件ずつ1行に展開された形で含まれており、報告されている場合は各リストファミリー(制裁、PEP、警告、ネガティブメディア)のデータセット更新日も記載されます。Business ConsoleでもAMLの結果の横に同じエクスポートが用意されています。各値の意味については[継続的なAMLモニタリング](https://docs.didit.me/ja/core-technology/aml-screening/continuous-monitoring-aml-screening.md)を参照してください。


## OpenAPI

````yaml ja/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ファイルとしてダウンロードします。完了した再スクリーニングごとに1行で、新しい順に並び、そのまま監査担当者に渡せます。ファイルは一括でストリーミングされ（ページネーションなし）、先頭にヘッダー行があります。空のセルは不明を意味し、データセットの日付が推定されることはありません。また、スプレッドシートの数式として解釈される文字で始まる値にはアポストロフィが付加されます。KYCとKYBのセッションIDのどちらにも使用でき、セッションで複数のAMLステップが実行された場合は`node_id`を指定してください。1か月分をエクスポートするには`month`を指定します。エラーはCSVではなくJSONで返されます。スコープ付きの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(`POST
            /v3/session/`が返す`session_id`)。ユーザー認証(KYC)と法人確認(KYB)の両方のセッションIDを受け付けます。サーバーは両方のセッションタイプにわたってIDを解決します。正しい形式のUUIDである必要があります。形式が不正な値はルートに一致せず、HTMLの`404`を返します。
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: node_id
          in: query
          required: false
          description: >-
            AMLチェックのワークフローグラフのノードID。セッションで複数のAMLステップが実行された場合にのみ必要です。指定しない場合は最新のAMLチェックが使用されます。不明なノードを指定すると`404`が返されます。
          schema:
            type: string
            example: feature_aml_1
        - name: month
          in: query
          required: false
          description: >-
            `YYYY-MM`形式のUTC暦月。その月に完了したスクリーニングのみが返されます。指定しない場合はすべての月が返されます。形式が不正な月を指定すると`400`が返されます。
          schema:
            type: string
            pattern: ^\d{4}-(0[1-9]|1[0-2])$
            example: 2026-09
      responses:
        '200':
          description: >-
            CSVファイル。CRLF改行の`text/csv`としてストリーミングされます。列は次の順です:
            `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`（不明な場合は空）。日付はUTCオフセット付きのISO
            8601形式です。まだ再スクリーニングが行われていないセッションでは、ヘッダー行のみが返されます。
          headers:
            Content-Disposition:
              description: >-
                `attachment;
                filename="aml-screening-history-{sessionId}.csv"`、または`month`を渡した場合は`aml-screening-history-{sessionId}-{month}.csv`です。
              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: >-
            認証または認可に失敗しました。キーがない場合、別のアプリケーションのキーの場合、このエンドポイントに必要な権限を持たないスコープ付きキーの場合、キーのIP許可リスト外からのリクエストの場合は`403`を返し、誤った、失効した、または期限切れのキーの場合は`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: >-
            セッションが存在しない、削除されている、またはスコープ付きキーの制限外であるか、（指定された`node_id`について）AMLチェックがありません。セッションの照会は認証情報の確認より前に行われるため、有効なキーがなくても、不明な`sessionId`には`404`が返されます。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 人が読めるエラーメッセージ。
              examples:
                Unknown session:
                  summary: このIDのセッションが存在しないか、削除されています
                  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: >-
            レート制限を超過しました。GETリクエストはAPIキーごとに1分あたり600件までです。`Retry-After`秒待ってから再試行してください。`X-RateLimit-*`ヘッダーで利用枠を確認できます。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 人が読めるエラーメッセージ。
              examples:
                Rate limited:
                  summary: 現在の1分間の上限を使い切りました
                  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キーです。Business ConsoleのDevelopers -> API
        keysで取得できます。プライマリキーはフルアクセス権を持ちます。名前付きキーにはスコープを設定できます。リソースごとのアクセス権（なし、読み取り、書き込み）、一部のワークフローまたは承認済みセッションへの限定、IPアドレスのリストへの限定、有効期限の設定です。401は、キーが誤っている、失効している、または期限切れであることを意味します。403は、キーが送信されていない、キーにこのリソースやアクションへのアクセス権がない、またはIPリスト外のアドレスからリクエストが送信されたことを意味します。セッションのルートでの404は、セッションがキーのワークフローまたはステータスの対象外であることを意味します。メディアへのアクセス権がないキーでは、画像、動画、PDFのURLがnullで返されます。セッションの書き込み権限がないキーでは、セッションのリンクとトークンがnullで返されます。詳細は次を参照してください:
        https://docs.didit.me/console/api-keys

````

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