> ## 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：セッション項目をブロック

> POST /v3/blocklist/add/：Diditの認証セッションの顔、書類、電話番号、メールアドレスをブロックリストに追加し、一致する新規セッションを自動で却下します。



ブロックリスト追加APIプロンプト
        プロンプトをクリップボードにコピー



      
      

\<pre>

\`Blocklist the face, document, phone number or email address of one of my Didit verification sessions through the Management API.

Endpoint:
POST https://verification.didit.me/v3/blocklist/add/

Authentication:
Use the x-api-key header with my Didit API key. A scoped API key needs workflows: write.

Goal:
\- After reviewing a fraudulent session, block what it collected so the same person is declined next time.

Request body (application/json):
\{
"session_id": "33333333-4444-5555-6666-777777777777", // required: a verification session of my application
"blocklist_face": true,       // optional, default false
"blocklist_document": true,   // optional, default false
"blocklist_phone": false,     // optional, default false
"blocklist_email": false      // optional, default false
}
At least one blocklist_* flag must be true.

Behavior:
\- Didit uses the session's most recent record of each selected type.
\- Each selected record is flagged as blocklisted and gets an entry, linked to the session, in the matching system blocklist (added_by "api").
\- From then on, new sessions with a matching face, document number, phone number or email address are declined.
\- The session itself and sessions that already finished are not changed.
\- Safe to repeat: an item already listed keeps its single entry, and its blocklisted_at is refreshed.
\- All or nothing: Didit checks every selected item first. If one is missing, nothing is blocklisted.
\- A document needs its issuing state, document type, document number and full name.

Example call:
curl -X POST "https://verification.didit.me/v3/blocklist/add/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session_id": "33333333-4444-5555-6666-777777777777", "blocklist_face": true, "blocklist_document": true}'

Example response (200):
\{ "message": "Successfully updated blocklist." }

Failure modes:
\- 400: session_id is missing ({ "session_id": ["This field is required."] }) or not a UUID ({ "session_id": ["Must be a valid UUID."] }); the session is not a verification session of this application ({ "non_field_errors": ["Session not found"] }; business verification sessions are not accepted); no flag is true ({ "non_field_errors": ["Must specify at least one item to blocklist"] }); the session has no record of a selected type ({ "non_field_errors": ["Session does not have a face record"] }); or the document lacks a required field.
\- 401: the API key has expired.
\- 403: missing x-api-key (a wrong, revoked or expired key gets 401) ({ "detail": "You do not have permission to perform this action." }), or a scoped key without workflows: write.
\- 429: rate limited (see /integration/rate-limiting); back off and retry.

Side effects:
\- Writes entries to the system face, document, phone and email blocklists and blocks matching new sessions.

To block a value without a session, or an IP address, device fingerprint, user or business, use POST /v3/lists/{list_uuid}/entries/ on the matching system blocklist instead.

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

\</pre>



      
      

貼り付け先

1件の検証セッションで収集した顔、本人確認書類、電話番号、メールアドレスをブロックリストに登録します。Diditは選択された各レコードをブロックリスト登録済みとしてマークし、セッションに紐づけた状態で、対応するシステムブロックリストに追加します。以降、顔、書類番号、電話番号、メールアドレスのいずれかが一致する新しいセッションは却下されます。> [!NOTE]
>
> この呼び出しは全件成功か全件失敗のどちらかです。選択した種類のレコードがセッションに存在しない場合、または書類に発行州、書類の種類、書類番号、氏名のいずれかが欠けている場合は`400`を返し、何もブロックリストに登録されません。すでにブロックリストに登録済みの項目に対してこの呼び出しを繰り返しても問題ありません。ブロックされている項目を確認するには、[ブロックリスト登録項目の一覧](https://docs.didit.me/ja/management-api/blocklist/list.md)を使用します。ブロックを解除するには、[ブロックリストから削除](https://docs.didit.me/ja/management-api/blocklist/remove.md)を使用します。IPアドレス、デバイスフィンガープリント、ユーザー、企業、またはセッションに紐づかない値をブロックするには、[エントリーの作成](https://docs.didit.me/ja/management-api/lists/create-entry.md)で対応するシステムブロックリストにエントリーを追加します。ブロックリストがどのように適用されるかについては、[ユーザーブロックリスト](https://docs.didit.me/ja/entities/users/blocklist.md)を参照してください。


## OpenAPI

````yaml ja/openapi-25.json POST /v3/blocklist/add/
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/blocklist/add/:
    post:
      tags:
        - Blocklist
      summary: セッションの項目をブロックリストに追加
      description: >-
        アプリケーションの本人確認セッション1件について、顔、身分証明書類、電話番号、またはメールアドレスをブロックリストに登録します。選択された種類ごとに、Diditはセッションの最新のレコードを取得してブロックリスト登録済みとしてフラグを付け、セッションに紐づくエントリを対応するシステムのブロックリストに追加します（`added_by:
        "api"`）。これにより、顔、書類番号、電話番号、またはメールアドレスが一致する新しいセッションは却下されます。選択されたすべての項目が最初にチェックされるため、1つでも欠けている場合は何もブロックリストに登録されません。すでに登録済みの項目に対して呼び出しを繰り返すと、エントリは1件のまま維持され、`blocklisted_at`が更新されます。セッション自体と、すでに完了したセッションは変更されません。スコープ付きのAPIキーには`workflows:
        write`が必要です。
      operationId: add_to_blocklist
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - session_id
              description: 少なくとも1つの`blocklist_*`フラグが`true`である必要があります。
              properties:
                session_id:
                  type: string
                  format: uuid
                  description: アプリケーションの個人認証セッション。削除済みのセッションは拒否されます。
                blocklist_face:
                  type: boolean
                  default: false
                  description: セッションの顔をブロックリストに登録します。
                blocklist_document:
                  type: boolean
                  default: false
                  description: セッションの身分証明書類をブロックリストに登録します。書類には発行国、書類の種類、書類番号、氏名が必要です。
                blocklist_phone:
                  type: boolean
                  default: false
                  description: セッションの電話番号をブロックリストに登録します。
                blocklist_email:
                  type: boolean
                  default: false
                  description: セッションのメールアドレスをブロックリストに登録します。
            examples:
              Face and document:
                value:
                  session_id: 33333333-4444-5555-6666-777777777777
                  blocklist_face: true
                  blocklist_document: true
              Phone only:
                value:
                  session_id: 33333333-4444-5555-6666-777777777777
                  blocklist_phone: true
      responses:
        '200':
          description: 選択した項目がブロックリストに追加されました。
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    description: 常に`Successfully updated blocklist.`です。
              examples:
                Blocklisted:
                  value:
                    message: Successfully updated blocklist.
        '400':
          description: >-
            ボディが無効であるか、セッションがこのアプリケーションの検証セッションではないか、選択した種類の記録がセッションにありません。何もブロックリストに追加されていません。
          content:
            application/json:
              examples:
                Unknown session:
                  value:
                    non_field_errors:
                      - Session not found
                No item selected:
                  value:
                    non_field_errors:
                      - Must specify at least one item to blocklist
                No face record:
                  value:
                    non_field_errors:
                      - Session does not have a face record
                Incomplete document:
                  value:
                    non_field_errors:
                      - >-
                        To blocklist a document, the document must have an
                        issuing state, document type, document number and full
                        name
                Invalid session id:
                  value:
                    session_id:
                      - Must be a valid UUID.
                Missing session id:
                  value:
                    session_id:
                      - This field is required.
        '401':
          description: スコープ付きAPIキーの有効期限が切れています。その他の認証エラーでは`403`が返されます。
          content:
            application/json:
              examples:
                Expired API key:
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            `x-api-key`ヘッダーがありません（誤った、失効した、または期限切れのキーには`401`が返されます）。または、スコープ付きAPIキーに`workflows:
            write`がないか、許可リスト外のIPアドレスから使用されています。
          content:
            application/json:
              examples:
                Missing or invalid API key:
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without workflows access:
                  value:
                    detail: This API key has no write access to workflows.
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/blocklist/add/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "session_id": "33333333-4444-5555-6666-777777777777",
                "blocklist_face": true,
                "blocklist_document": true
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.blocklist.add(
                session_id="33333333-4444-5555-6666-777777777777",
                blocklist_face=True,
                blocklist_document=True,
            )
            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.blocklist.add({
              session_id: "33333333-4444-5555-6666-777777777777",
              blocklist_face: true,
              blocklist_document: true,
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Blocklist.Add(ctx, didit.BlocklistAddParams{\n\tSessionID:         \"33333333-4444-5555-6666-777777777777\",\n\tBlocklistFace:     didit.Bool(true),\n\tBlocklistDocument: didit.Bool(true),\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.BlocklistAddParams;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            var result = client.blocklist().add(BlocklistAddParams.builder()
                    .sessionId("33333333-4444-5555-6666-777777777777")
                    .blocklistFace(true)
                    .blocklistDocument(true)
                    .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->blocklist->add([
                'session_id' => '33333333-4444-5555-6666-777777777777',
                'blocklist_face' => true,
                'blocklist_document' => true,
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.blocklist.add(
              session_id: "33333333-4444-5555-6666-777777777777",
              blocklist_face: true,
              blocklist_document: true
            )
            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.Blocklist.AddAsync(new BlocklistAddParams
            {
                SessionId = "33333333-4444-5555-6666-777777777777",
                BlocklistFace = true,
                BlocklistDocument = true,
            });
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  responses:
    RateLimitedWrite:
      description: APIキーあたり毎分300リクエストの共有書き込み制限を超えました。再試行する前に`Retry-After`に従ってください。
      content:
        application/json:
          schema:
            type: object
            required:
              - detail
            properties:
              detail:
                type: string
          example:
            detail: >-
              Write request rate limit exceeded. You can make up to 300 requests
              per minute.
  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.