> ## 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：書類OCRと真正性チェック

> Diditの本人確認書類認証APIは220+の国と14,000+種類の書類に対応。真正性チェック、OCR、MRZ読み取り、sub-2sの推論、従量課金、契約不要。



## OpenAPI

````yaml ja/openapi-25.json POST /v3/id-verification/
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/id-verification/:
    post:
      tags:
        - Standalone APIs
      summary: 本人確認（書類のOCRと不正チェック）
      description: >-
        本人確認書類のOCRと書類の不正チェックを1回の呼び出しで実行します。抽出された所持者のフィールド、解析済みのMRZ、`Approved`/`Declined`/`In
        Review`の`status`、検出されたすべての問題を説明する`warnings`リストを返します。220+の国と地域の14,000+種類の書類に対応しています。


        **仕組み。**
        書類の`front_image`（必須）と、両面書類の場合は`back_image`を送信します。書類の四隅がすべて写った、トリミングしていない写真をアップロードしてください。サービス側で書類の検出、位置補正、切り抜きを行うため、事前にトリミングしないでください。書類は自動的に分類され（国や書類の種類を指定する必要はありません）、視覚ゾーンはOCRで読み取られ、MRZとバーコードがあればデコードされます。続いてクロスチェックで日付、番号の形式、MRZのチェックディジットが検証され、視覚ゾーンとMRZが照合されます。`perform_document_liveness=true`の場合は、画面の再撮影、印刷コピー、顔写真の改ざんについても画像が追加でスクリーニングされます。


        **判定ロジック。**
        1つでも警告が却下となる場合を除き、`status`は`Approved`になります。不正およびハードフェイルのリスクは常に却下となります：`DOCUMENT_EXPIRED`、`SCREEN_CAPTURE_DETECTED`、`PRINTED_COPY_DETECTED`、`PORTRAIT_MANIPULATION_DETECTED`、`PUBLIC_DOCUMENT_IMAGE_DETECTED`、および抽出の失敗（`NAME_NOT_DETECTED`、`DATE_OF_BIRTH_NOT_DETECTED`、`DOCUMENT_NUMBER_NOT_DETECTED`）です。（`PORTRAIT_IMAGE_NOT_DETECTED`、`INVALID_DATE`、`MRZ_NOT_DETECTED`はワークフローのセッションには存在しますが、このスタンドアロンのエンドポイントで生成されることはありません。`COULD_NOT_DETECT_DOCUMENT_TYPE`は、表面画像が既知の公的書類のデザインと高い信頼度で一致しない場合にここで返され、リクエストは却下されます。）3つのリスクグループは、`invalid_mrz_action`、`inconsistent_data_action`、`expiration_date_not_detected_action`（`DECLINE`または`NO_ACTION`）によりリクエストごとに設定できます。その他の警告（例：`POSSIBLE_DUPLICATED_USER`）は情報提供用であり、それだけで却下となることはありません。`perform_document_liveness=true`（デフォルト）で偽造チェックが有効なスコアを返さない場合（プロバイダーが失敗した、200以外で応答した、または`status="ERR"`を含むHTTP
        200で応答した場合）、呼び出しは`Approved`ではなく、`status: "In
        Review"`と`DOCUMENT_LIVENESS_NOT_COMPUTED`警告（`log_type:
        "warning"`）を含む`200`を返します。実行されなかったチェックは、書類が本物である証拠にはならないためです。このエスカレーションは設定できず、`Declined`を上書きすることもありません。`perform_document_liveness=false`の場合はチェックがスキップされ、ステータスは従来どおり残りの警告に従います。まったく処理できない書類の場合は`{"error":
        "COULD_NOT_RECOGNIZE_DOCUMENT"}`とともに`400`が返されます。読み取りはできても問題のある書類の場合は`status:
        "Declined"`とともに`200`が返されます。HTTPコードだけでなく、必ず`id_verification.status`と`id_verification.warnings`を確認してください。


        **請求。**
        `200`レスポンスごとに本人確認APIのクレジットを1つ消費します（プランのクレジットまたはチャージ残高から支払われます）。組織の残高で呼び出しを賄えない場合、エンドポイントは画像処理を行う前に、クレジット不足エラーとともに`403`を返します。


        **セッションの保存（`save_api_request`、デフォルトは`true`）。**
        `true`の場合、呼び出しはAPIタイプのセッションとして保存されます。Business
        Consoleに表示され、返される`request_id`は`GET
        /v3/session/{sessionId}/decision/`に渡せる実際のセッションIDとなり、切り抜かれた書類と顔写真の画像は保存されて有効期間の短いメディアURL（`https://<media-host>/ocr/...`）として返され、設定済みのWebhookエンドポイントに`status.updated`
        Webhookが送信されます。`false`の場合は何も保存されず、`request_id`は一度限りの相関用UUIDとなり、`portrait_image`/`front_image`/`back_image`はbase64エンコードされたJPEG文字列としてインラインで返されます。


        **サンドボックス。**
        サンドボックスのAPIキーでは、すべての処理と請求がスキップされます。リクエストの検証後（不正な形式の入力には引き続き`400`が返されます）、エンドポイントは固定の`Approved`モックペイロード（架空の「Sandbox
        User」の米国IDカード）を返します。セッションは保存されず、クレジットも消費されません。


        **認証。**
        アプリケーションのAPIキーを`x-api-key`ヘッダーで送信してください。認証情報がない、または無効な場合は`403`（`{"detail":
        "You do not have permission to perform this
        action."}`）が返されます。このAPIが`401`を返すことはありません。


        **レート制限。**
        すべてのPOST/PATCH/DELETEエンドポイントで共有される書き込み上限は、APIキーごとに毎分300リクエストです。超過すると`429`が返されます。
      operationId: post_v3id-verification
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - front_image
              properties:
                front_image:
                  type: string
                  format: binary
                  description: >-
                    本人確認書類の表面。使用可能な拡張子:
                    `tiff`、`jpg`、`jpeg`、`png`、`webp`、`pdf`。最大アップロードサイズ: **10
                    MB**（これを超えるファイルは`400`で拒否されます）。PDFはOCRの前に画像にレンダリングされます。暗号化されたPDFには`front_image_password`が必要です。画像は自動的に約0.5
                    MBに圧縮され、EXIFの向き情報が適用されます。書類の四隅がすべて写った、トリミングしていない撮影画像をそのままアップロードしてください。
                front_image_password:
                  type: string
                  description: >-
                    `front_image`が暗号化されたPDFの場合に復号するためのパスワード。暗号化されたPDFをパスワードなし（または誤ったパスワード）で送信すると`400`が返ります。
                  writeOnly: true
                back_image:
                  type: string
                  format: binary
                  description: >-
                    書類の裏面。書類に裏面がある場合は必ず送信してください（多くのIDカードは裏面にMRZやバーコードがあります。省略するとレスポンスのMRZおよび裏面のフィールドが空になるだけで、このエンドポイントはMRZ欠落の警告を出しません）。形式とサイズの制限は`front_image`と同じです。省略した場合、レスポンスの`back_image`と裏面のフィールドは`null`になります。
                back_image_password:
                  type: string
                  description: '`back_image`が暗号化されたPDFの場合に復号するためのパスワード。'
                  writeOnly: true
                perform_document_liveness:
                  type: boolean
                  default: true
                  description: >-
                    両方の画像に対してプレゼンテーション不正のスクリーニングを行います。対象は、画面のリプレイ(`SCREEN_CAPTURE_DETECTED`)、印刷されたコピー(`PRINTED_COPY_DETECTED`)、顔写真の改ざん(`PORTRAIT_MANIPULATION_DETECTED`)です。いずれかが検出されると自動的に却下されます。デフォルトで有効です。不正スクリーニングをスキップしてレイテンシを短縮するには`false`に設定します。有効な状態でプロバイダーが使用可能なスコアを返さない場合、レスポンスは`Approved`ではなく、`DOCUMENT_LIVENESS_NOT_COMPUTED`警告付きの`In
                    Review`になります。
                  example: true
                minimum_age:
                  type: integer
                  nullable: true
                  default: null
                  minimum: 1
                  maximum: 120
                  description: >-
                    受け付けられ、検証もされます（1〜120）が、このエンドポイントでは**現在適用されていません**。このフィールドによって`MINIMUM_AGE_NOT_MET`警告が生成されることはありません。返された`date_of_birth`/`age`をもとに年齢ルールを適用するか、年齢制限を設定した認証セッションのワークフローを使用してください。
                expiration_date_not_detected_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    有効期限を読み取れない場合の処理です（`EXPIRATION_DATE_NOT_DETECTED`）。多くの本人確認書類には有効期限が印字されていないため、デフォルトは`NO_ACTION`です。注意：有効期限が*検出され、かつ期限を過ぎている*場合は、この設定に関係なく常に却下されます（`DOCUMENT_EXPIRED`）。
                invalid_mrz_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: DECLINE
                  description: >-
                    抽出したMRZがチェックディジット検証に失敗した場合（`MRZ_VALIDATION_FAILED`）の対応です。このエンドポイントでは、MRZがなくても警告は発生しません。MRZを持つ書類にのみ関係します。このエンドポイントでは`REVIEW`はサポートされておらず、`400`が返されます。
                inconsistent_data_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: DECLINE
                  description: >-
                    抽出データの内部に矛盾がある場合の処理です。`DATA_INCONSISTENT`、`MRZ_AND_DATA_EXTRACTED_FROM_OCR_NOT_SAME`（視覚ゾーンとMRZが一致しない）、または`DOCUMENT_NAME_DIFFERENT_FROM_OTHER_APPROVED_DOCUMENTS`が該当します。
                critical_field_occlusion_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: DECLINE
                  description: >-
                    撮影画像上で重要な印字フィールド（ID番号、氏名、生年月日、有効期限）が物理的に覆われていた場合の処理です（`CRITICAL_FIELD_OCCLUSION_DETECTED`）。このエンドポイントの他の書類完全性リスクと同様、デフォルトでは却下されます。レポートの照合対象となる番号が覆われている状態は、まさに墨消しされた書類の特徴だからです。いずれの場合も、覆われたフィールドから読み取られた値は抽出結果から除外されるため、通常は対応する`*_NOT_DETECTED`警告も併せて出力されます。このエンドポイントでは`REVIEW`はサポートされておらず、`400`を返します。
                document_or_personal_number_format_mismatch_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    番号が、発行機関がその書類タイプで使用する形式と一致しない場合の処理です（`DOCUMENT_NUMBER_FORMAT_MISMATCH`、`PERSONAL_NUMBER_FORMAT_MISMATCH`）。デフォルトは`NO_ACTION`で、ステータスを変更せずに警告を報告します。このエンドポイントでは`REVIEW`はサポートされておらず、`400`を返します。
                preferred_characters:
                  type: string
                  enum:
                    - latin
                    - non_latin
                  default: latin
                  description: >-
                    ラテン文字と非ラテン文字（アラビア文字、キリル文字、CJKなど）の両方が印字された書類で、氏名・住所フィールドに使用する優先文字体系。`latin`は翻字済みまたはラテン文字の値を返し、`non_latin`は元の文字体系を優先します。
                save_api_request:
                  type: boolean
                  default: true
                  description: >-
                    `true`（デフォルト）の場合、呼び出しはAPIタイプのセッションとして保存されます。このセッションはBusiness
                    Consoleに表示され、返された`request_id`を使って`GET
                    /v3/session/{sessionId}/decision/`で取得でき、`status.updated`Webhookで通知され、書類画像はメディアURLとして返されます。`false`の場合、何も保存されず、`request_id`は一時的なUUIDになり、画像はbase64形式のJPEG文字列としてインラインで返されます。
                  example: true
                vendor_data:
                  type: string
                  description: >-
                    任意の不透明な文字列（社内のユーザーID、メールアドレス、UUIDなど）です。保存されたセッションに格納され、レスポンスでそのまま返されます。API呼び出しを自社の記録と関連付けたり、後でセッションを絞り込んだりするために使用します。
                  example: user-123
                metadata:
                  type: object
                  additionalProperties: true
                  description: >-
                    セッションとともに保存され（`save_api_request=true`の場合）、レスポンスでそのまま返される任意のJSONオブジェクトです。マルチパートリクエストでは、JSONエンコードされた文字列フィールドとして送信してください（例:
                    `metadata={"flow":"onboarding"}`）。オブジェクトとして解析されます。
                  example:
                    flow: onboarding
            example:
              front_image: (binary JPEG/PNG/PDF of the document front)
              back_image: (binary JPEG/PNG/PDF of the document back)
              perform_document_liveness: true
              save_api_request: true
              vendor_data: user-123
              metadata:
                flow: onboarding
      responses:
        '200':
          description: >-
            書類が処理されました。`id_verification.status`は`Approved`、`Declined`、`In
            Review`のいずれかで、検出されたすべての問題は`id_verification.warnings`に個別に列挙されます。`In
            Review`は、リクエストされた書類ライブネスチェックで有効な結果が得られなかった場合(`DOCUMENT_LIVENESS_NOT_COMPUTED`)に返されます。問題のある書類でも`status:
            "Declined"`とともに`200`が返されるため、HTTPコードだけでなくボディを確認してください。`save_api_request=true`の場合、`request_id`は永続化されたセッションIDで、画像フィールドは有効期間の短いメディアURLになります。`save_api_request=false`の場合はインラインのbase64
            JPEG文字列になります。
          content:
            application/json:
              examples:
                Approved:
                  summary: 両面IDカードを正常に読み取り（保存済み、画像はメディアURL）
                  value:
                    request_id: 11d219ed-d59c-4b1d-8d65-9b933f12d5b8
                    id_verification:
                      status: Approved
                      document_type: Identity Card
                      document_subtype: ID_CARD_GENERIC
                      document_number: CBX164224
                      personal_number: 20446581H
                      portrait_image: >-
                        https://<media-host>/ocr/11d219ed-d59c-4b1d-8d65-9b933f12d5b8-portrait_image-8c2f.jpg?signature=...
                      front_image: >-
                        https://<media-host>/ocr/11d219ed-d59c-4b1d-8d65-9b933f12d5b8-front_image-4a1e.jpg?signature=...
                      back_image: >-
                        https://<media-host>/ocr/11d219ed-d59c-4b1d-8d65-9b933f12d5b8-back_image-77b0.jpg?signature=...
                      front_image_camera_front: null
                      back_image_camera_front: null
                      front_image_camera_front_face_match_score: null
                      back_image_camera_front_face_match_score: null
                      front_image_quality_score:
                        focus_score: 78
                        brightness_score: 83.2
                        brightness_issue: ok
                        is_document_fully_visible: true
                        resolution_score: 40.7
                        overall_score: 70.2
                      back_image_quality_score:
                        focus_score: 100
                        brightness_score: 95.6
                        brightness_issue: ok
                        is_document_fully_visible: true
                        resolution_score: 43
                        overall_score: 84.4
                      date_of_birth: '1980-01-13'
                      age: 46
                      expiration_date: '2032-03-31'
                      date_of_issue: '2022-03-31'
                      issuing_state: ESP
                      issuing_state_name: Spain
                      first_name: Julio Francisco
                      last_name: Fores Sena
                      full_name: Julio Francisco Fores Sena
                      gender: M
                      address: >-
                        Brda. Urb. El Cardonal 0052 52 Po3 B,Taco,San Cristobal
                        De La Laguna,Santa Cruz De Tenerife
                      formatted_address: >-
                        Av. el Cardonal, 52, b, 38108 La Laguna, Santa Cruz de
                        Tenerife, Spain
                      place_of_birth: Valencia, Valencia
                      marital_status: UNKNOWN
                      nationality: ESP
                      extra_fields:
                        first_surname: Fores
                        second_surname: Sena
                      mrz:
                        surname: FORES SENA
                        name: JULIO FRANCISCO
                        country: ESP
                        nationality: ESP
                        birth_date: '800113'
                        expiry_date: '320331'
                        sex: M
                        document_type: ID
                        document_number: CBX164224
                        optional_data: 20446581H
                        optional_data_2: ''
                        birth_date_hash: '9'
                        expiry_date_hash: '8'
                        document_number_hash: '3'
                        final_hash: '3'
                        personal_number: 20446581H
                        warnings: []
                        errors: []
                        mrz_type: TD1
                        mrz_string: |-
                          IDESPCBX164224320446581H<<<<<<
                          8001139M3203318ESP<<<<<<<<<<<3
                          FORES<SENA<<JULIO<FRANCISCO<<<
                        mrz_key: CBX164224380011393203318
                      parsed_address:
                        street_1: Avenida el Cardonal 52
                        street_2: b
                        city: La Laguna
                        region: Canarias
                        country: ES
                        postal_code: '38108'
                        address_type: Avenida
                        formatted_address: >-
                          Av. el Cardonal, 52, b, 38108 La Laguna, Santa Cruz de
                          Tenerife, Spain
                        raw_results:
                          address_components:
                            - long_name: b
                              short_name: b
                              types:
                                - subpremise
                            - long_name: '52'
                              short_name: '52'
                              types:
                                - street_number
                            - long_name: Avenida el Cardonal
                              short_name: Av. el Cardonal
                              types:
                                - route
                            - long_name: La Laguna
                              short_name: La Laguna
                              types:
                                - locality
                                - political
                            - long_name: Spain
                              short_name: ES
                              types:
                                - country
                                - political
                            - long_name: '38108'
                              short_name: '38108'
                              types:
                                - postal_code
                          formatted_address: >-
                            Av. el Cardonal, 52, b, 38108 La Laguna, Santa Cruz
                            de Tenerife, Spain
                          geometry:
                            location:
                              lat: 28.4501161
                              lng: -16.3004407
                            location_type: ROOFTOP
                          types:
                            - street_address
                            - subpremise
                        document_location:
                          latitude: 28.4501161
                          longitude: -16.3004407
                        label: Spain Identity Card Address
                        is_verified: true
                        category: Residential
                      warnings: []
                      barcodes: []
                    vendor_data: user-123
                    metadata:
                      flow: onboarding
                    created_at: '2026-06-12T02:21:56.013573+00:00'
                Declined - expired document:
                  summary: 期限切れIDカードの表面のみのアップロード
                  value:
                    request_id: f61681b8-9422-4378-ac3e-04c6a247fb45
                    id_verification:
                      status: Declined
                      document_type: Identity Card
                      document_subtype: ID_CARD_GENERIC
                      document_number: BNK123072
                      personal_number: 21771255F
                      portrait_image: >-
                        https://<media-host>/ocr/f61681b8-9422-4378-ac3e-04c6a247fb45-portrait_image-1d9a.jpg?signature=...
                      front_image: >-
                        https://<media-host>/ocr/f61681b8-9422-4378-ac3e-04c6a247fb45-front_image-5c2b.jpg?signature=...
                      back_image: null
                      front_image_camera_front: null
                      back_image_camera_front: null
                      front_image_camera_front_face_match_score: null
                      back_image_camera_front_face_match_score: null
                      front_image_quality_score:
                        focus_score: 100
                        brightness_score: 95.7
                        brightness_issue: ok
                        is_document_fully_visible: true
                        resolution_score: 22.2
                        overall_score: 79.3
                      back_image_quality_score: null
                      date_of_birth: '1997-01-30'
                      age: 29
                      expiration_date: '2025-11-26'
                      date_of_issue: null
                      issuing_state: ESP
                      issuing_state_name: Spain
                      first_name: Lucia
                      last_name: Marin Castro
                      full_name: Lucia Marin Castro
                      gender: F
                      address: null
                      formatted_address: null
                      place_of_birth: null
                      marital_status: UNKNOWN
                      nationality: ESP
                      extra_fields:
                        first_surname: Marin
                        second_surname: Castro
                      mrz: {}
                      parsed_address: null
                      warnings:
                        - risk: DOCUMENT_EXPIRED
                          feature: ID_VERIFICATION
                          additional_data: null
                          log_type: error
                          short_description: Document expired
                          long_description: >-
                            The document's expiration date has passed, rendering
                            it no longer valid for use.
                      barcodes: []
                    vendor_data: user-123
                    metadata: null
                    created_at: '2026-06-12T02:25:48.117204+00:00'
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    format: uuid
                    description: >-
                      `save_api_request=true`の場合は保存されたセッションID(`GET
                      /v3/session/{sessionId}/decision/`で使用可能)、それ以外の場合は一時的な相関UUIDです。
                  id_verification:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - Approved
                          - Declined
                          - In Review
                        description: >-
                          却下に該当する警告がなく、要求された書類のライブネスチェックで有効な結果が得られた場合は`Approved`、要求されたチェックで有効な結果が得られなかった場合（`DOCUMENT_LIVENESS_NOT_COMPUTED`）は`In
                          Review`、警告が却下に該当する場合は`Declined`になります。理由は`warnings`リストで確認できます。
                      document_type:
                        type: string
                        nullable: true
                        description: >-
                          検出された書類タイプの表示名：`Identity Card`、`Passport`、`Driver's
                          License`、`Residence Permit`、`Health Insurance
                          Card`、または`Tax Card`。書類を分類できなかった場合は`null`です。
                        example: Identity Card
                      document_subtype:
                        type: string
                        nullable: true
                        description: >-
                          利用可能な場合の、より詳細なサブタイプです（例：`ID_CARD_GENERIC`、`EPASSPORT`）。
                        example: ID_CARD_GENERIC
                      document_number:
                        type: string
                        nullable: true
                        example: CBX164224
                      personal_number:
                        type: string
                        nullable: true
                        description: 一部の書類に記載されている副次的な個人番号または国民番号。
                        example: 20446581H
                      portrait_image:
                        type: string
                        nullable: true
                        description: >-
                          書類から切り抜いた顔写真。`save_api_request=true`（デフォルト）の場合は有効期間の短いメディアURL（`https://<media-host>/ocr/...`）、`save_api_request=false`の場合はbase64でエンコードされたインラインのJPEG文字列です。顔写真が検出されなかった場合は`null`です。
                      front_image:
                        type: string
                        nullable: true
                        description: >-
                          書類表面の位置補正済みクロップ画像です。保存されている場合はメディアURL、それ以外の場合はインラインのbase64
                          JPEGです。
                      back_image:
                        type: string
                        nullable: true
                        description: >-
                          書類裏面の位置補正済みクロップ画像です。`back_image`がアップロードされていない場合は`null`です。
                      front_image_camera_front:
                        type: string
                        nullable: true
                        description: このエンドポイントでは常に`null`です（カメラ撮影による認証セッションでのみ値が入ります）。
                      back_image_camera_front:
                        type: string
                        nullable: true
                        description: このエンドポイントでは常に`null`です。
                      front_image_camera_front_face_match_score:
                        type: number
                        nullable: true
                        description: このエンドポイントでは常に`null`です。
                      back_image_camera_front_face_match_score:
                        type: number
                        nullable: true
                        description: このエンドポイントでは常に`null`です。
                      front_image_quality_score:
                        type: object
                        nullable: true
                        description: >-
                          アップロードされた画像の撮影品質診断（その面が提供されなかった場合、またはスコアリングに失敗した場合は`null`）。すべてのスコアは0〜100です。
                        properties:
                          focus_score:
                            type: number
                            format: float
                            description: 書類の切り抜き画像の鮮明度（値が高いほど鮮明）。
                          brightness_score:
                            type: number
                            format: float
                            description: エクスポージャーの品質です（高いほど良好）。
                          brightness_issue:
                            type: string
                            nullable: true
                            description: >-
                              露出に問題がない場合は`ok`、それ以外の場合は検出された問題（例: 暗すぎる /
                              明るすぎる）です。
                          is_document_fully_visible:
                            type: boolean
                            nullable: true
                            description: 書類の四隅すべてがフレーム内に収まっているかどうかです。
                          resolution_score:
                            type: number
                            format: float
                            description: 書類領域の実効解像度。
                          overall_score:
                            type: number
                            format: float
                            description: 集約品質スコア。
                      back_image_quality_score:
                        type: object
                        nullable: true
                        description: >-
                          アップロードされた画像の撮影品質診断（その面が提供されなかった場合、またはスコアリングに失敗した場合は`null`）。すべてのスコアは0〜100です。
                        properties:
                          focus_score:
                            type: number
                            format: float
                            description: 書類の切り抜き画像の鮮明度（値が高いほど鮮明）。
                          brightness_score:
                            type: number
                            format: float
                            description: エクスポージャーの品質です（高いほど良好）。
                          brightness_issue:
                            type: string
                            nullable: true
                            description: >-
                              露出に問題がない場合は`ok`、それ以外の場合は検出された問題（例: 暗すぎる /
                              明るすぎる）です。
                          is_document_fully_visible:
                            type: boolean
                            nullable: true
                            description: 書類の四隅すべてがフレーム内に収まっているかどうかです。
                          resolution_score:
                            type: number
                            format: float
                            description: 書類領域の実効解像度。
                          overall_score:
                            type: number
                            format: float
                            description: 集約品質スコア。
                      date_of_birth:
                        type: string
                        format: date
                        nullable: true
                        example: '1980-01-13'
                      age:
                        type: integer
                        nullable: true
                        description: 保有者の年齢(歳)です。`date_of_birth`から算出されます。
                        example: 46
                      expiration_date:
                        type: string
                        format: date
                        nullable: true
                        example: '2032-03-31'
                      date_of_issue:
                        type: string
                        format: date
                        nullable: true
                        example: '2022-03-31'
                      issuing_state:
                        type: string
                        nullable: true
                        description: 発行国（ISO 3166-1 alpha-3）。
                        example: ESP
                      issuing_state_name:
                        type: string
                        nullable: true
                        example: Spain
                      first_name:
                        type: string
                        nullable: true
                        example: Julio Francisco
                      last_name:
                        type: string
                        nullable: true
                        example: Fores Sena
                      full_name:
                        type: string
                        nullable: true
                        example: Julio Francisco Fores Sena
                      gender:
                        type: string
                        nullable: true
                        description: '`M`、`F`、または印字されていない、もしくは検出されなかった場合は`null`です。'
                        example: M
                      address:
                        type: string
                        nullable: true
                        description: 書類に記載されているとおりの住所。
                      formatted_address:
                        type: string
                        nullable: true
                        description: '`address`をジオコーディングして正規化したもの。'
                      place_of_birth:
                        type: string
                        nullable: true
                        example: Valencia, Valencia
                      marital_status:
                        type: string
                        nullable: true
                        description: 書類に婚姻状況が記載されていない限り、`UNKNOWN`です。
                        example: UNKNOWN
                      nationality:
                        type: string
                        nullable: true
                        description: 保有者の国籍(ISO 3166-1 alpha-3)です。
                        example: ESP
                      extra_fields:
                        type: object
                        nullable: true
                        additionalProperties: true
                        description: >-
                          専用の列がない書類固有の追加情報です（例：スペインのIDの`first_surname`/`second_surname`、運転免許証の免許区分）。
                      mrz:
                        type: object
                        description: >-
                          解析済みの機械読み取りゾーン。書類にMRZがない場合、またはMRZを読み取れなかった場合は**空のオブジェクト**(`{}`)になります。その場合は`warnings`リストも確認してください。MRZ内の日付は未加工の`YYMMDD`形式です。
                        properties:
                          surname:
                            type: string
                            example: FORES SENA
                          name:
                            type: string
                            example: JULIO FRANCISCO
                          country:
                            type: string
                            description: 発行国（ISO 3166-1 alpha-3）。
                            example: ESP
                          nationality:
                            type: string
                            description: 保有者の国籍(ISO 3166-1 alpha-3)です。
                            example: ESP
                          birth_date:
                            type: string
                            description: MRZの生の生年月日（`YYMMDD`）。
                            example: '800113'
                          expiry_date:
                            type: string
                            description: MRZの生の有効期限（`YYMMDD`）。
                            example: '320331'
                          sex:
                            type: string
                            example: M
                          document_type:
                            type: string
                            description: 'MRZの書類種別コード（例: `ID`、`P`）。'
                            example: ID
                          document_number:
                            type: string
                            example: CBX164224
                          optional_data:
                            type: string
                            nullable: true
                            example: 20446581H
                          optional_data_2:
                            type: string
                            nullable: true
                            example: ''
                          birth_date_hash:
                            type: string
                            description: 生年月日のMRZチェックディジット。
                            example: '9'
                          expiry_date_hash:
                            type: string
                            description: 有効期限のMRZチェックディジット。
                            example: '8'
                          document_number_hash:
                            type: string
                            description: 書類番号のMRZチェックディジット。
                            example: '3'
                          final_hash:
                            type: string
                            description: MRZの総合チェックディジット。
                            example: '3'
                          personal_number:
                            type: string
                            nullable: true
                            example: 20446581H
                          warnings:
                            type: array
                            items:
                              type: string
                            description: 致命的ではないMRZ解析の警告。
                          errors:
                            type: array
                            items:
                              type: string
                            description: >-
                              MRZのチェックディジットおよび解析のエラー。空でないエラーは`MRZ_VALIDATION_FAILED`警告として表示されます。
                          mrz_type:
                            type: string
                            description: >-
                              MRZのレイアウト:
                              `TD1`（IDカード、3行）、`TD2`、または`TD3`（パスポート、2行）。
                            example: TD1
                          mrz_string:
                            type: string
                            description: 読み取られたままのMRZの生テキスト。各行は`\n`で区切られます。
                          mrz_key:
                            type: string
                            description: クロスチェックに使用される複合キー（書類番号+チェックディジット）。
                      parsed_address:
                        type: object
                        nullable: true
                        description: >-
                          `address`を構造化し、ジオコーディングした内訳。書類に住所が含まれていない場合、または解析できなかった場合は`null`です。
                        properties:
                          street_1:
                            type: string
                            nullable: true
                            example: Avenida el Cardonal 52
                          street_2:
                            type: string
                            nullable: true
                            example: b
                          city:
                            type: string
                            nullable: true
                            example: La Laguna
                          region:
                            type: string
                            nullable: true
                            example: Canarias
                          country:
                            type: string
                            nullable: true
                            description: ISO 3166-1 alpha-2国コード。
                            example: ES
                          postal_code:
                            type: string
                            nullable: true
                            example: '38108'
                          address_type:
                            type: string
                            nullable: true
                            example: Avenida
                          formatted_address:
                            type: string
                            nullable: true
                            description: ジオコーディングされた正規形式の住所文字列。
                            example: >-
                              Av. el Cardonal, 52, b, 38108 La Laguna, Santa
                              Cruz de Tenerife, Spain
                          raw_results:
                            type: object
                            additionalProperties: true
                            description: >-
                              高度な利用者向けの、ジオコーディングの生のペイロード（`address_components`、`geometry.location`、`place_id`など）。
                          document_location:
                            type: object
                            nullable: true
                            properties:
                              latitude:
                                type: number
                              longitude:
                                type: number
                            description: 書類の住所をジオコーディングした座標。
                          label:
                            type: string
                            nullable: true
                            description: 住所を読み取った書類のフィールド。
                            example: Spain Identity Card Address
                          is_verified:
                            type: boolean
                            description: ジオコーディングにより住所の存在が確認されたかどうかです。
                          category:
                            type: string
                            nullable: true
                            description: 住所の区分（例：`Residential`、`Commercial`）。
                            example: Residential
                      warnings:
                        type: array
                        description: >-
                          問題なく承認された場合は空です。各エントリは検出されたリスク1件を説明します。`log_type:
                          "error"`のエントリは`status`を`Declined`に設定し、`DOCUMENT_LIVENESS_NOT_COMPUTED`（`log_type:
                          "warning"`）は`In Review`に設定します。
                        items:
                          type: object
                          properties:
                            risk:
                              type: string
                              description: >-
                                機械可読なリスクコードです。常に却下となるリスク：`DOCUMENT_EXPIRED`、`MINIMUM_AGE_NOT_MET`、`PORTRAIT_IMAGE_NOT_DETECTED`、`SCREEN_CAPTURE_DETECTED`、`PRINTED_COPY_DETECTED`、`PORTRAIT_MANIPULATION_DETECTED`、`PUBLIC_DOCUMENT_IMAGE_DETECTED`、`INVALID_DATE`、`COULD_NOT_RECOGNIZE_DOCUMENT`（400でのみ返され、警告になることはありません）、`DOCUMENT_NUMBER_NOT_DETECTED`、`COULD_NOT_DETECT_DOCUMENT_TYPE`、`NAME_NOT_DETECTED`、`DATE_OF_BIRTH_NOT_DETECTED`。リクエストオプションで制御されるリスク：`MRZ_NOT_DETECTED`
                                /
                                `MRZ_VALIDATION_FAILED`（`invalid_mrz_action`）、`DATA_INCONSISTENT`
                                / `MRZ_AND_DATA_EXTRACTED_FROM_OCR_NOT_SAME` /
                                `DOCUMENT_NAME_DIFFERENT_FROM_OTHER_APPROVED_DOCUMENTS`（`inconsistent_data_action`）、`EXPIRATION_DATE_NOT_DETECTED`（`expiration_date_not_detected_action`）。その他のリスク（例：`POSSIBLE_DUPLICATED_USER`）は情報提供のみです。`DOCUMENT_LIVENESS_NOT_COMPUTED`は、`perform_document_liveness=true`であるにもかかわらず偽造チェックが有効なスコアを返さなかった場合に発生し、`status`を`In
                                Review`に設定します。`COULD_NOT_DETECT_DOCUMENT_TYPE`は、書類の表面が既知の公的書類のデザインと高い信頼度で一致しない場合にも返されます。たとえば、編集された書類やコンピューターで生成された書類、まだサポートされていないデザインなどです。
                              example: DOCUMENT_EXPIRED
                            feature:
                              type: string
                              enum:
                                - ID_VERIFICATION
                              description: 警告を発生させた機能。このエンドポイントでは常に`ID_VERIFICATION`です。
                            additional_data:
                              type: object
                              nullable: true
                              additionalProperties: true
                              description: >-
                                一部のリスクに関する追加情報です（例:
                                `POSSIBLE_DUPLICATED_USER`には`duplicated_session_id`が含まれます）。ほとんどの場合は`null`です。
                            log_type:
                              type: string
                              enum:
                                - error
                                - warning
                                - information
                              description: >-
                                重大度。`error`の警告は`status`を`Declined`にします。`warning`（`DOCUMENT_LIVENESS_NOT_COMPUTED`のみ。リクエストされた偽造チェックで使用可能なスコアが得られなかった場合）は`status`を`In
                                Review`にします。`information`のエントリーは参考情報であり、ステータスを変更することはありません。
                            short_description:
                              type: string
                              description: リスクを人が読める形で1行にまとめた要約。
                            long_description:
                              type: string
                              description: リスクを人が読める形で説明したもの。
                      barcodes:
                        type: array
                        description: >-
                          書類からデコードされたバーコード（PDF417、QRなど）。書類にバーコードがない場合、または読み取れなかった場合は空です。
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              description: 'バーコードの種類（例: `PDF417`、`QR_CODE`、`UNKNOWN`）。'
                            position:
                              type: object
                              nullable: true
                              additionalProperties: true
                              description: 画像内のバーコードの位置（利用可能な場合）。
                            data:
                              type: string
                              description: デコードされたペイロード。
                            data_raw:
                              type: string
                              description: デコード前の生のペイロード（異なる場合）。
                            side:
                              type: string
                              nullable: true
                              description: '`front`または`back`。'
                  vendor_data:
                    type: string
                    nullable: true
                    description: 送信した`vendor_data`のエコー、または`null`。
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: 送信した`metadata`オブジェクトのエコー、または`null`。
                  created_at:
                    type: string
                    format: date-time
                    description: レスポンスが生成された日時を示すISO 8601タイムスタンプ（UTC）。
        '400':
          description: >-
            バリデーションまたは処理のエラーです。フィールド単位の問題は、DRFの標準エンベロープ(問題のあるフィールドごとにメッセージの配列が1つ)で返されます。暗号化されたPDFの問題は`{"detail":
            ...}`を返します。書類をまったく認識できない書類画像は`{"error":
            "COULD_NOT_RECOGNIZE_DOCUMENT"}`を返します。PDFのアップロードでは、さらに「The submitted
            PDF file is corrupted or invalid.」またはページがないことを示すエラーで失敗する場合があります。
          content:
            application/json:
              examples:
                Missing front image:
                  summary: フォームデータに`front_image`が含まれていません
                  value:
                    front_image:
                      - No file was submitted.
                Unsupported file extension:
                  summary: ファイル拡張子がtiff/jpg/jpeg/png/webp/pdf以外
                  value:
                    front_image:
                      - >-
                        File extension “txt” is not allowed. Allowed extensions
                        are: tiff, jpg, jpeg, png, webp, pdf.
                File too large:
                  summary: アップロードが10MBの上限を超えています
                  value:
                    front_image:
                      - File size should not exceed 10 MB
                Invalid option value:
                  summary: 選択肢はDECLINEまたはNO_ACTIONのみ受け付けます
                  value:
                    invalid_mrz_action:
                      - '"REVIEW" is not a valid choice.'
                Encrypted PDF:
                  summary: 必要なパスワードなしでPDFがアップロードされました
                  value:
                    detail: >-
                      The PDF is encrypted. Please upload a decrypted PDF or a
                      photo instead.
                Wrong PDF password:
                  summary: '`front_image_password` / `back_image_password`でPDFを復号できません'
                  value:
                    detail: >-
                      The PDF password is incorrect. Please provide the correct
                      password.
                Document not recognized:
                  summary: 画像から本人確認書類を検出できませんでした
                  value:
                    error: COULD_NOT_RECOGNIZE_DOCUMENT
                PDF conversion failure:
                  summary: アップロードされたPDFを画像に変換できませんでした
                  value:
                    error: Failed to convert front image PDF.
        '403':
          description: >-
            権限がありません。`x-api-key`ヘッダーがない場合に加え、呼び出し元の組織の残高が呼び出しを賄えない場合にも返されます。誤った、取り消された、または期限切れのキーの場合は`401`が返されます。キーがない場合は`{"detail":
            ...}`とともに`403`が返され、誤った、取り消された、または期限切れのキーの場合は`401`が返されます。クレジット不足の場合は、画像の処理が行われる前に`{"error":
            ...}`とともに`403`が返されます。
          content:
            application/json:
              examples:
                Missing or invalid API key:
                  summary: '`x-api-key`ヘッダーがないか、キーが無効または失効しています'
                  value:
                    detail: You do not have permission to perform this action.
                Not enough credits:
                  summary: 組織の残高でこの呼び出しの料金を賄えません
                  value:
                    error: >-
                      You don't have enough credits to perform this request.
                      Please top up at https://business.didit.me
        '429':
          description: >-
            レート制限を超過しました。すべてのPOST/PATCH/DELETEエンドポイントは、APIキーごとに1分あたり300件の書き込みリクエストという共通の上限を共有します。レスポンスには`X-RateLimit-Limit`、`X-RateLimit-Remaining`、`X-RateLimit-Reset`、`Retry-After`ヘッダーが含まれます。
          content:
            application/json:
              examples:
                Write rate limit exceeded:
                  summary: 現在の1分間に300件を超える書き込みリクエスト
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
              schema:
                type: object
                properties:
                  detail:
                    type: string
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST 'https://verification.didit.me/v3/id-verification/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -F 'front_image=@./id_front.jpg' \
              -F 'back_image=@./id_back.jpg' \
              -F 'perform_document_liveness=true' \
              -F 'save_api_request=true' \
              -F 'vendor_data=user-123'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.id_verification.verify(
                front_image=open("front_image.jpg", "rb"),
                back_image=open("back_image.jpg", "rb"),
                perform_document_liveness=True,
                save_api_request=True,
                vendor_data="user-123",
                metadata={"flow": "onboarding"},
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit, { fileFromPath } from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.idVerification.verify({
              front_image: await fileFromPath("front_image.jpg"),
              back_image: await fileFromPath("back_image.jpg"),
              perform_document_liveness: true,
              save_api_request: true,
              vendor_data: "user-123",
              metadata: { flow: "onboarding" },
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.IDVerification.Verify(ctx, didit.IDVerificationVerifyParams{\n\tFrontImage:              didit.FileFromPath(\"front_image.jpg\"),\n\tBackImage:               didit.Some(didit.FileFromPath(\"back_image.jpg\")),\n\tPerformDocumentLiveness: didit.Bool(true),\n\tSaveAPIRequest:          didit.Bool(true),\n\tVendorData:              didit.String(\"user-123\"),\n\tMetadata:                didit.Some(map[string]any{\"flow\": \"onboarding\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.nio.file.Path;

            import java.util.Map;

            import me.didit.Didit;

            import me.didit.types.IdVerificationVerifyParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.idVerification().verify(IdVerificationVerifyParams.builder()
                    .frontImage(Path.of("front_image.jpg"))
                    .backImage(Path.of("back_image.jpg"))
                    .performDocumentLiveness(true)
                    .saveApiRequest(true)
                    .vendorData("user-123")
                    .metadata(Map.of("flow", "onboarding"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;
            use Didit\File;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->idVerification->verify([
                'front_image' => File::fromPath('front_image.jpg'),
                'back_image' => File::fromPath('back_image.jpg'),
                'perform_document_liveness' => true,
                'save_api_request' => true,
                'vendor_data' => 'user-123',
                'metadata' => ['flow' => 'onboarding'],
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.id_verification.verify(
              front_image: Pathname("front_image.jpg"),
              back_image: Pathname("back_image.jpg"),
              perform_document_liveness: true,
              save_api_request: true,
              vendor_data: "user-123",
              metadata: { flow: "onboarding" }
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Collections.Generic;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.IdVerification.VerifyAsync(new
            IdVerificationVerifyParams

            {
                FrontImage = FileUpload.FromPath("front_image.jpg"),
                BackImage = FileUpload.FromPath("back_image.jpg"),
                PerformDocumentLiveness = true,
                SaveApiRequest = true,
                VendorData = "user-123",
                Metadata = new Dictionary<string, object> { ["flow"] = "onboarding" },
            });

            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.