> ## 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チェックステータス更新API

> DiditのAPIで、セッションのAMLスクリーニングチェックのステータスを設定します。ヒットを解消した後に承認済みにするなど、セッション全体の判定は変更されません。



AMLチェックのステータスを更新するAPIのプロンプト
        プロンプトをクリップボードにコピー



      
      

\<pre>

\`Set the status of the AML screening check of a Didit verification session through the API.

Endpoint:
PATCH https://verification.didit.me/v3/session/{session_id}/update-aml-status/

Authentication:
Send my Didit API key in the x-api-key header. A scoped key needs decisions: write.

Goal:
\- Record my compliance decision on a session's AML check as a whole (the status of an aml_screenings[] entry in the session decision), for example Approved after my team cleared every hit.

Request body (JSON):
\- status (required): "Approved", "Declined", "In Review", "Not Finished" or "Resub Requested".
\- node_id (optional): the workflow node ID of the AML check when the session ran several AML steps. It can also be sent as the node_id query parameter. Without it the most recent AML check is updated.

Behavior:
\- Works for user (KYC) and business (KYB) session IDs.
\- Only the AML check changes. The session status is not recomputed: use PATCH /v3/session/{session_id}/update-status/ to change the session decision, and PATCH /v3/session/{session_id}/update-aml-hit-status/ to mark individual hits.
\- When the status changes, Didit adds an AML_STATUS_UPDATED activity entry and sends a data.updated webhook.
\- Sending the status the check already has returns 200 and changes nothing (no activity entry, no webhook).

Example call:
curl -X PATCH "https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/update-aml-status/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "Approved"}'

What to read from the response:
\- status: the AML check status now.
\- previous_status: the status before the call (equal to status when nothing changed).

Failure modes:
\- 400: status missing or not one of the allowed values.
\- 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: write, 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). This is checked before the body, so it wins over a 400.

Side effects: changes the AML check status, adds an activity entry and sends a data.updated webhook (only when the status changed).

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

\</pre>



      
      

貼り付け先

チェック全体ではなく個々のマッチについて判定するには、[AMLヒットのステータス更新](https://docs.didit.me/ja/sessions-api/update-aml-hit-status.md)を使用します。スクリーニング結果とステータスがどのように生成されるかについては、[AMLスクリーニング](https://docs.didit.me/ja/core-technology/aml-screening/overview.md)を参照してください。


## OpenAPI

````yaml ja/openapi-25.json PATCH /v3/session/{sessionId}/update-aml-status/
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}/update-aml-status/:
    patch:
      tags:
        - Sessions
      summary: AMLチェックのステータスを更新
      description: >-
        セッションのAMLスクリーニングチェック全体のステータス(セッションの判定における`aml_screenings[]`エントリの`status`)を設定します。たとえば、チームがすべてのヒットを解消した後に`Approved`に設定します。KYCとKYBのセッションIDに対応しています。セッションで複数のAMLステップが実行された場合は`node_id`(クエリパラメーターまたはボディのフィールド)を渡してください。渡さない場合は、最新のAMLチェックが更新されます。ステータスが実際に変更されると、`AML_STATUS_UPDATED`アクティビティエントリが記録され、`data.updated`
        [Webhook](https://docs.didit.me/ja/integration/webhooks)が送信されます。現在のステータスを送信した場合は`200`が返され、何も変更されません。セッションのステータスは再計算されません。セッションの判定には`PATCH
        /v3/session/{sessionId}/update-status/`を、単一のヒットには`PATCH
        /v3/session/{sessionId}/update-aml-hit-status/`を使用してください。スコープ付きのAPIキーには`decisions:
        write`が必要です。
      operationId: patch_v3_session_update_aml_status
      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ステップが実行された場合にのみ必要です。ボディ内の`node_id`より優先されます。
          schema:
            type: string
            example: feature_aml_1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - Not Finished
                    - Approved
                    - Declined
                    - In Review
                    - Resub Requested
                  description: AMLチェックの新しいステータス。
                  example: Approved
                node_id:
                  type: string
                  description: AMLチェックのワークフローグラフのノードID。クエリパラメーターの代わりに指定できます。
                  example: feature_aml_1
            example:
              status: Approved
      responses:
        '200':
          description: 設定されたAMLチェックのステータス（すでにこの値だった場合は変更なし）。
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - status
                  - previous_status
                properties:
                  message:
                    type: string
                    description: 常に`AML status updated successfully`です。
                  status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: 現在のAMLチェックのステータス。
                  previous_status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: 呼び出し前のステータス。何も変更されなかった場合は`status`と同じです。
              example:
                message: AML status updated successfully
                status: Approved
                previous_status: In Review
        '400':
          description: >-
            バリデーションエラー:
            `status`がない、または許可された値のいずれでもありません。AMLチェックの検索が先に実行されるため、AMLチェックのないセッションでは、ボディが無効であっても`404`が返されます。
          content:
            application/json:
              examples:
                Missing status:
                  summary: 空のボディ、またはstatusなし
                  value:
                    status:
                      - This field is required.
                Invalid status:
                  summary: statusがenumに含まれていません
                  value:
                    status:
                      - '"Cleared" is not a valid choice.'
        '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 write:
                  summary: 'スコープ付きキーにdecisions: write権限がない'
                  value:
                    detail: This API key has no write access to decisions.
                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: >-
            レート制限を超過しました。書き込み（POST、PATCH、DELETE）リクエストはAPIキーごとに1分あたり300件までです。`Retry-After`秒待ってから再試行してください。`X-RateLimit-*`ヘッダーで利用枠を確認できます。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 人が読めるエラーメッセージ。
              examples:
                Rate limited:
                  summary: 現在の1分間の上限を使い切りました
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      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 PATCH
            'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/update-aml-status/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"status": "Approved"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.update_aml_status(
                "11111111-2222-3333-4444-555555555555",
                status="Approved",
            )
            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.updateAmlStatus("11111111-2222-3333-4444-555555555555",
            {
              status: "Approved",
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.UpdateAMLStatus(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SessionsUpdateAMLStatusParams{\n\tStatus: \"Approved\",\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.SessionsUpdateAmlStatusParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().updateAmlStatus("11111111-2222-3333-4444-555555555555",
            SessionsUpdateAmlStatusParams.builder()
                    .status(SessionsUpdateAmlStatusParams.Status.of("Approved"))
                    .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->sessions->updateAmlStatus('11111111-2222-3333-4444-555555555555',
            [
                'status' => 'Approved',
            ]);

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

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

            result = didit.sessions.update_aml_status(
              "11111111-2222-3333-4444-555555555555",
              status: "Approved"
            )
            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.UpdateAmlStatusAsync("11111111-2222-3333-4444-555555555555",
            new SessionsUpdateAmlStatusParams

            {
                Status = "Approved",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
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.