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

# 電話番号OTP確認API：SMSコードを検証

> DiditのPOST /v3/phone/check/で電話番号のOTPを検証し、キャリア種別、仮想番号、使い捨て番号を検出します。従量課金制で、月額の最低利用料金はありません。

## プロバイダー障害への対応

電話番号プロバイダーが一時的に利用できない場合、このエンドポイントは安定した機械可読コードとともに`502`を返します。

```json theme={null}
{
  "detail": "The phone verification provider is temporarily unavailable.",
  "code": "phone_provider_unavailable"
}
```

このレスポンスは再試行可能なものとして扱ってください。短いバックオフを設定し、有効な電話番号やコードの変更をユーザーに求めるのではなく、サービスが一時的に利用できない旨のメッセージを表示してください。

## インテリジェンスアドオン

`enable_enrichment`を`true`に設定すると、番号に対して電話番号インテリジェンスも実行されます。リスクスコア、回線種別、番号が最近ポーティングされたかどうか、信頼インデックスが得られます。
このアドオンは、チェックの料金に加えて、定価でリクエスト1件あたり\$0.05が請求されます。
残高が不足している場合、リクエストは`403`を返します。

4つのフィールドで、各シグナルに対する処理を決定します。
各フィールドの値は`NO_ACTION`(デフォルト)または`DECLINE`で、いずれも`enable_enrichment`が`true`の場合にのみ有効になります。

| フィールド | 却下される条件 |
| - | - |
| `phone_intelligence_score_action` | リスクスコアがしきい値を上回っている。 |
| `phone_type_risk_action` | 番号が高リスクの回線種別である。 |
| `recent_port_action` | 番号が最近ほかの通信事業者にポーティングされた。 |
| `low_phone_trust_action` | 信頼インデックスがしきい値以下である。 |

`NO_ACTION`の場合もシグナルは`phone.phone_intelligence`で返されるため、独自のルールを適用できます。


## OpenAPI

````yaml ja/openapi-25.json POST /v3/phone/check/
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/phone/check/:
    post:
      tags:
        - Standalone APIs
      summary: 電話番号コードを確認
      description: >-
        [`POST
        /v3/phone/send/`](/ja/standalone-apis/phone-send)で送信されたOTPを検証し、最終的な検証結果と電話番号インテリジェンスを取得します。電話番号インテリジェンスには、キャリア名と回線種別、仮想番号(VoIP)および使い捨て番号のフラグ、自社のセッション間での番号の重複利用が含まれます。


        **検証の照合方法。**
        照合はアプリケーションとE.164形式の`phone_number`の組み合わせで行われます。`request_id`は入力として使用されません。直近**5分**以内に作成された保留中の検証のうち、最新のものがチェックされます。該当するものがない場合(未送信、確定済み、または作成から5分以上経過)、エンドポイントは`200`と`status:
        "Expired or Not Found"`を返します。


        **試行回数の上限。** 各検証では**3回までコードを入力**できます。1回目と2回目の誤ったコードでは、残りの試行回数と`phone:
        null`を含む`status:
        "Failed"`が返されます。3回目の誤ったコードで検証は`Declined`として確定し、`VERIFICATION_CODE_ATTEMPTS_EXCEEDED`警告とともに完全な電話番号レポートが返されます。


        **結果。**
        `Approved`：コードが正しく、却下につながるリスクがない場合です。`Declined`：最終状態です。コードは正しいものの却下につながるリスク(下記の`DECLINE`アクション、ブロックリストに登録された番号または高リスクの番号)に該当した場合、または試行回数の上限に達した場合です。`Failed`：コードが誤っており、試行回数が残っている場合です。`Expired
        or Not
        Found`：チェック対象がない場合です。`Approved`/`Declined`の場合、`request_id`は送信時の`request_id`(セッションID)と同じで、`phone`には完全なレポート(`carrier`、`is_virtual`、`is_disposable`、`warnings`、`lifecycle`、`matches`)が含まれます。`Failed`および`Expired
        or Not Found`の場合、`request_id`は1回限りのランダムなUUIDです。


        **リスクアクション。**
        `duplicated_phone_number_action`、`disposable_number_action`、`voip_number_action`は、正しいコードで該当するリスクが検出された場合の動作を決定します。`DECLINE`は最終ステータスを`Declined`に変更します。`NO_ACTION`(デフォルト)はステータスに影響を与えず、リスクを`phone.warnings`に記録します。


        **請求。**
        チェックは無料です。配信は送信側で課金されます([電話番号検証の料金](/ja/getting-started/phone-verification-pricing)を参照)。


        **セッションへの反映。** 確定したチェックは、送信時に作成されたセッションを更新し(Business Consoleで確認でき、`GET
        /v3/session/{sessionId}/decision/`で照会可能)、`status.updated` Webhookを発行します。


        **サンドボックス。**
        サンドボックスのAPIキーでは、すべての処理がスキップされます。形式が正しいコード(4〜8桁、`123456`を含む)であれば、簡略化されたフラットな`phone`オブジェクト(`status`、`phone_number`、`country_code`、`carrier_name`、`line_type`、`flags`)を含む固定の`Approved`ペイロードが返されます。形式が不正な入力の場合は、引き続き`400`が返されます。データは一切保存されません。


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


        **レート制限。**
        APIキーごとに毎分300リクエストの共有書き込み上限があり、さらに上流の不正利用防止上限として番号ごとに1時間あたり4回の試行制限があります。いずれかを超えると`429`が返されます。


        **ソーシャルフットプリント。**
        `enable_social`を`true`に設定すると、`phone_social`ブロックが追加されます。このブロックには、この番号が登録されているオンラインプラットフォームが、カテゴリ別の件数および取得可能なプロフィール詳細とともに含まれます。`profiles_registered:
        0`は、プラットフォームを確認した結果、いずれにもこの番号が見つからなかったことを意味し、有効かつ課金対象の回答です。アドオンがリクエストされなかった場合、またはチェックを完了できなかった場合、このブロックは含まれず、その場合は課金されません。請求では、このエンドポイント自体の料金に加えて、リクエストごとに`phone_social`1ユニットが加算されます。
      operationId: post_v3phone_check
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                phone_number:
                  type: string
                  maxLength: 20
                  description: >-
                    対応する[`POST
                    /v3/phone/send/`](/ja/standalone-apis/phone-send)の呼び出しで使用したものと同じ電話番号で、E.164形式です。この値によって、確認と送信が紐付けられます。
                  example: '+14155552671'
                code:
                  type: string
                  minLength: 4
                  maxLength: 8
                  pattern: ^[0-9]{4,8}$
                  description: >-
                    エンドユーザーが受け取ったOTP。4〜8桁の数字である必要があります。それ以外の場合は試行回数を消費せずに`400`を返します。形式は正しいものの誤ったコードの場合は`200`と`status:
                    "Failed"`を返し、3回の試行のうち1回を消費します。
                  example: '123456'
                duplicated_phone_number_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    同じ電話番号が、アプリケーションの別のユーザー（異なる`vendor_data`）によってすでに使用されている場合の対応です。`DECLINE`は最終的な`status`を`Declined`に切り替え、`NO_ACTION`はリスクを`phone.warnings`に記録して`phone.matches`を設定します。
                disposable_number_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    キャリア照会でその番号が一時的な使い捨て回線と判定された場合の処理です（`phone.is_disposable`）。`DECLINE`は最終的な`status`を`Declined`に変更し、`NO_ACTION`はリスクを`phone.warnings`に記録します。
                voip_number_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    キャリア照会で仮想回線タイプ（`voip`、`isp`、`vpn`）と報告された場合の処理です（`phone.is_virtual`）。`DECLINE`は最終的な`status`を`Declined`に変更し、`NO_ACTION`はリスクを`phone.warnings`に記録します。
                enable_enrichment:
                  type: boolean
                  default: false
                  description: >-
                    `true`の場合、その番号に対して電話番号インテリジェンスも実行します（リスクスコア、回線種別、最近番号ポータビリティで移転されたかどうか、信頼指数）。このエンドポイント自体の料金に加えて、リクエストごとに`phone_intelligence_api`1ユニット（定価で$0.05）として課金されます。残高が不足している場合、リクエストは`403`を返します。
                  example: false
                phone_intelligence_score_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    電話番号インテリジェンスのリスクスコアがしきい値を超えた場合のアクション。`DECLINE`は最終的な`status`を`Declined`に変更し、`NO_ACTION`は却下せずにシグナルを記録します。`enable_enrichment`が`true`の場合にのみ有効です。
                phone_type_risk_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    番号が高リスクの回線種別である場合のアクション。`DECLINE`は最終的な`status`を`Declined`に変更し、`NO_ACTION`は却下せずにシグナルを記録します。`enable_enrichment`が`true`の場合にのみ有効です。
                recent_port_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    番号が最近別の通信事業者にポートアウトされた場合のアクション。`DECLINE`は最終的な`status`を`Declined`に変更し、`NO_ACTION`は却下せずにシグナルを記録します。`enable_enrichment`が`true`の場合にのみ有効です。
                low_phone_trust_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    電話番号インテリジェンスの信頼性指数がしきい値以下の場合のアクション。`DECLINE`は最終的な`status`を`Declined`に変更し、`NO_ACTION`は却下せずにシグナルを記録します。`enable_enrichment`が`true`の場合にのみ有効です。
                enable_social:
                  type: boolean
                  default: false
                  description: >-
                    trueの場合、番号のソーシャルフットプリント（その番号が登録されているメッセージング、ソーシャル、EC、ビジネスの各プラットフォーム）も検索します。このエンドポイント自体の料金に加えて、リクエスト1件ごとに`phone_social`1ユニット分が請求されます。
                  example: true
                phone_no_social_presence_action:
                  type: string
                  enum:
                    - NO_ACTION
                    - DECLINE
                  default: NO_ACTION
                  description: >-
                    ソーシャルフットプリントチェックで、対象となるいずれのプラットフォームにもこの電話番号が登録されていないと判明した場合のアクション。このエンドポイントで指定できるのはNO_ACTIONとDECLINEのみです。REVIEWは、ワークフロー設定の同名のキーで利用できます。
              required:
                - phone_number
                - code
            examples:
              Default:
                summary: リスクは記録するが、自動で却下は行わない
                value:
                  phone_number: '+14155552671'
                  code: '123456'
              Strict risk policy:
                summary: VoIP回線と使い捨て回線を自動で却下
                value:
                  phone_number: '+14155552671'
                  code: '123456'
                  voip_number_action: DECLINE
                  disposable_number_action: DECLINE
      responses:
        '200':
          description: >-
            チェックが完了しました。誤ったコードや存在しない検証の場合も`200`が返るため、HTTPコードではなく`status`を確認してください。`phone`は確定した結果（`Approved`/`Declined`）の場合のみ値が入り、`Failed`では`null`、`Expired
            or Not Found`では含まれません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneVerificationCheckResponse'
              examples:
                Approved:
                  summary: 正しいコード。通信事業者、ライフサイクル、一致情報を含む完全な電話番号レポート
                  value:
                    request_id: e39cb057-92fc-4b59-b84e-02fec29a0f24
                    status: Approved
                    message: The verification code is correct.
                    phone:
                      status: Approved
                      phone_number_prefix: '+1'
                      phone_number: '4155552671'
                      full_number: '+14155552671'
                      country_code: US
                      country_name: United States
                      carrier:
                        name: AT&T
                        type: mobile
                      is_disposable: false
                      is_virtual: false
                      verification_method: whatsapp
                      verification_attempts: 1
                      verified_at: '2026-06-12T01:24:47.311323Z'
                      warnings: []
                      lifecycle:
                        - type: PHONE_VERIFICATION_MESSAGE_SENT
                          timestamp: '2026-06-12T01:23:39.580554+00:00'
                          details:
                            status: Success
                            reason: null
                            channel: whatsapp
                            actual_channel: whatsapp
                          fee: 0.0509
                        - type: PHONE_DELIVERY_DELIVERED
                          timestamp: '2026-06-12T01:23:43.118220+00:00'
                          details:
                            channel: whatsapp
                            status: delivered
                          fee: 0
                        - type: VALID_CODE_ENTERED
                          timestamp: '2026-06-12T01:24:47.311201+00:00'
                          details:
                            code_tried: '123456'
                            status: Approved
                          fee: 0
                        - type: PHONE_VERIFICATION_APPROVED
                          timestamp: '2026-06-12T01:24:47.384292+00:00'
                          details: null
                          fee: 0
                      matches: []
                    vendor_data: user-1234
                    metadata: null
                    created_at: '2026-06-12T01:24:47.401719+00:00'
                Failed (attempts remaining):
                  summary: コードが正しくありません。ユーザーは再試行できます。ここでのrequest_idは使い捨てのUUIDです
                  value:
                    request_id: 11111111-2222-3333-4444-555555555555
                    status: Failed
                    message: 'The verification code is incorrect. Attempts remaining: 2'
                    phone: null
                    vendor_data: user-1234
                    metadata: null
                    created_at: '2026-06-12T01:24:21.512340+00:00'
                Declined (max attempts):
                  summary: 3回目の誤ったコード。認証はDeclinedとして確定します
                  value:
                    request_id: e39cb057-92fc-4b59-b84e-02fec29a0f24
                    status: Declined
                    message: >-
                      The verification code is incorrect. Maximum attempts
                      reached.
                    phone:
                      status: Declined
                      phone_number_prefix: '+1'
                      phone_number: '4155552671'
                      full_number: '+14155552671'
                      country_code: US
                      country_name: United States
                      carrier:
                        name: AT&T
                        type: mobile
                      is_disposable: false
                      is_virtual: false
                      verification_method: whatsapp
                      verification_attempts: 1
                      verified_at: null
                      warnings:
                        - feature: PHONE
                          risk: VERIFICATION_CODE_ATTEMPTS_EXCEEDED
                          additional_data: null
                          log_type: error
                          short_description: Verification code attempts exceeded
                          long_description: >-
                            The system detected that the phone number has
                            exceeded the maximum number of verification code
                            attempts.
                      lifecycle:
                        - type: PHONE_VERIFICATION_MESSAGE_SENT
                          timestamp: '2026-06-12T01:23:39.580554+00:00'
                          details:
                            status: Success
                            reason: null
                            channel: whatsapp
                            actual_channel: whatsapp
                          fee: 0.0509
                        - type: INVALID_CODE_ENTERED
                          timestamp: '2026-06-12T01:24:01.118220+00:00'
                          details:
                            code_tried: '111111'
                            status: Failed
                          fee: 0
                        - type: INVALID_CODE_ENTERED
                          timestamp: '2026-06-12T01:24:21.512340+00:00'
                          details:
                            code_tried: '222222'
                            status: Failed
                          fee: 0
                        - type: INVALID_CODE_ENTERED
                          timestamp: '2026-06-12T01:24:47.311201+00:00'
                          details:
                            code_tried: '333333'
                            status: Failed
                          fee: 0
                        - type: PHONE_VERIFICATION_DECLINED
                          timestamp: '2026-06-12T01:24:47.384292+00:00'
                          details:
                            reason: VERIFICATION_CODE_ATTEMPTS_EXCEEDED
                          fee: 0
                      matches: []
                    vendor_data: user-1234
                    metadata: null
                    created_at: '2026-06-12T01:24:47.401719+00:00'
                Declined (risk policy):
                  summary: コードは正しいが、回線がVoIPで、voip_number_action=DECLINEの場合
                  value:
                    request_id: 7f1c9d2e-44a1-4b6e-9a3e-5b8e6f1c2d3a
                    status: Declined
                    message: The verification code is correct.
                    phone:
                      status: Declined
                      phone_number_prefix: '+1'
                      phone_number: '5005550006'
                      full_number: '+15005550006'
                      country_code: US
                      country_name: United States
                      carrier:
                        name: CLEC LLC
                        type: voip
                      is_disposable: false
                      is_virtual: true
                      verification_method: sms
                      verification_attempts: 1
                      verified_at: '2026-06-12T01:24:47.311323Z'
                      warnings:
                        - feature: PHONE
                          risk: VOIP_NUMBER_DETECTED
                          additional_data: null
                          log_type: error
                          short_description: VoIP number detected
                          long_description: >-
                            The system detected that the phone number is a VoIP
                            number, which is not allowed.
                      lifecycle:
                        - type: PHONE_VERIFICATION_MESSAGE_SENT
                          timestamp: '2026-06-12T01:23:39.580554+00:00'
                          details:
                            status: Success
                            reason: null
                            channel: whatsapp
                            actual_channel: sms
                          fee: 0.0509
                        - type: VALID_CODE_ENTERED
                          timestamp: '2026-06-12T01:24:47.311201+00:00'
                          details:
                            code_tried: '123456'
                            status: Approved
                          fee: 0
                        - type: PHONE_VERIFICATION_DECLINED
                          timestamp: '2026-06-12T01:24:47.384292+00:00'
                          details:
                            reason: VOIP_NUMBER_DETECTED
                          fee: 0
                      matches: []
                    vendor_data: user-1234
                    metadata: null
                    created_at: '2026-06-12T01:24:47.401719+00:00'
                Expired or Not Found:
                  summary: 過去5分間にこの番号の保留中の検証はありません
                  value:
                    request_id: 69cc35c6-280a-47a6-ab8c-4f32abc02ed0
                    status: Expired or Not Found
                    message: No pending phone verification found in the last 5 minutes.
                    vendor_data: null
                    metadata: null
                    created_at: '2026-06-12T01:24:47.311323+00:00'
        '400':
          description: 検証エラー：DRFのフィールドエラーエンベロープです。問題のあるフィールドごとにメッセージの配列が1つ返されます。
          content:
            application/json:
              examples:
                Invalid code format:
                  summary: '`code`が4〜8桁の数字ではありません'
                  value:
                    code:
                      - Invalid code format. Enter 4 to 8 numeric digits.
                Invalid phone number:
                  summary: '`phone_number`が有効なE.164形式ではない'
                  value:
                    phone_number:
                      - Invalid phone number provided.
                Invalid action:
                  summary: リスクアクションにはNO_ACTIONまたはDECLINEのみ指定できます
                  value:
                    voip_number_action:
                      - '"REVIEW" is not a valid choice.'
        '403':
          description: >-
            権限がありません。`x-api-key`ヘッダーがない場合に返されます。誤った、取り消された、または期限切れのキーの場合は`401`が返されます。チェックは無料のため、ここではクレジットの確認は行われません。
          content:
            application/json:
              examples:
                Missing or invalid API key:
                  summary: '`x-api-key`ヘッダーがないか、キーが無効または失効しています'
                  value:
                    detail: You do not have permission to perform this action.
        '429':
          description: >-
            レート制限を超過しました。すべてのPOST/PATCH/DELETEエンドポイントは、APIキーごとに1分あたり300件の書き込みリクエストという共通の上限を共有します。さらに、上流では不正利用防止のため、電話番号ごとに1時間あたり4回の認証試行という上限が適用されます。レスポンスには`X-RateLimit-Limit`、`X-RateLimit-Remaining`、`X-RateLimit-Reset`、`Retry-After`ヘッダーが含まれます。注:
            `X-RateLimit-*`/`Retry-After`ヘッダーが付くのは1分あたり300件の書き込み制限による429のみです。電話番号ごとの上限による429にはレート制限ヘッダーは含まれません。
          content:
            application/json:
              examples:
                Per-number cap:
                  summary: 直近1時間に同じ番号に対して4回を超える認証試行
                  value:
                    detail: >-
                      Maximum verification attempts reached for this phone
                      number. Only 4 authentication attempts are allowed per
                      hour. Try again later or use a different number.
                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
        '500':
          description: >-
            上流でのコード検証中に発生した、既知のプロバイダー障害ではない予期しない障害。安全に再試行できます。試行回数の上限は、完了したチェックによってのみ消費されます。
          content:
            application/json:
              examples:
                Provider error:
                  summary: コード検証を完了できませんでした
                  value:
                    detail: Error checking phone verification
              schema:
                type: object
                properties:
                  detail:
                    type: string
        '502':
          description: >-
            電話番号検証のプロバイダーが一時的に利用できません。組み込みの再試行後も5xxレスポンス、タイムアウト、または接続失敗が解消しなかった状態です。安全に再試行できます。試行回数の上限は消費されません。
          content:
            application/json:
              examples:
                Provider outage:
                  summary: プロバイダーがチェックリクエストに応答しませんでした
                  value:
                    detail: >-
                      Phone verification is temporarily unavailable. Please try
                      again shortly.
                    code: phone_provider_unavailable
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST https://verification.didit.me/v3/phone/check/ \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "phone_number": "+14155552671",
                "code": "123456",
                "voip_number_action": "DECLINE"
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.phone.check_code(
                phone_number="+14155552671",
                code="123456",
            )
            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.phone.checkCode({
              phone_number: "+14155552671",
              code: "123456",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Phone.CheckCode(ctx, didit.PhoneCheckCodeParams{\n\tPhoneNumber: \"+14155552671\",\n\tCode:        \"123456\",\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.PhoneCheckCodeParams;

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

            var result = client.phone().checkCode(PhoneCheckCodeParams.builder()
                    .phoneNumber("+14155552671")
                    .code("123456")
                    .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->phone->checkCode([
                'phone_number' => '+14155552671',
                'code' => '123456',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.phone.check_code(
              phone_number: "+14155552671",
              code: "123456"
            )
            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.Phone.CheckCodeAsync(new
            PhoneCheckCodeParams

            {
                PhoneNumber = "+14155552671",
                Code = "123456",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    PhoneVerificationCheckResponse:
      type: object
      properties:
        request_id:
          type: string
          format: uuid
          description: >-
            `Approved`/`Declined`の場合は、一致した認証のセッションIDで、`POST
            /v3/phone/send/`が返す`request_id`と同一です。`Failed`および`Expired or Not
            Found`の場合は、後から照会できないランダムな一回限りのUUIDです。
        status:
          type: string
          enum:
            - Approved
            - Declined
            - Failed
            - Expired or Not Found
          description: >-
            `Approved`：コードが正しく、却下となるリスクもありません。`Declined`：最終状態です。却下となるリスクに該当したか、試行回数の上限（3回）に達しました。`Failed`：コードが誤っており、試行回数が残っています。`Expired
            or Not Found`：直近5分以内に、この電話番号に対する保留中の認証がありません。
        message:
          type: string
          description: 結果を人が読める形で説明したもの。誤ったコードが入力された後の残り試行回数を含みます。
        phone:
          type: object
          nullable: true
          description: >-
            完全な電話番号レポート。最終的な結果（`Approved`/`Declined`）の場合にのみ存在します（nullではありません）。`Failed`では`null`となり、`Expired
            or Not Found`では含まれません。
          properties:
            status:
              type: string
              enum:
                - Approved
                - Declined
                - In Review
                - Not Finished
                - Expired
              description: 電話番号検証の最終ステータスです。確定済みのチェックでは、トップレベルの`status`と一致します。
            phone_number_prefix:
              type: string
              description: '先頭に`+`を付けた国際電話の国番号(例: `+1`)。'
              example: '+1'
            phone_number:
              type: string
              description: 国番号を除いた国内番号。
              example: '4155552671'
            full_number:
              type: string
              description: E.164形式の完全な番号。
              example: '+14155552671'
            country_code:
              type: string
              nullable: true
              description: 番号の国を示すISO 3166-1 alpha-2コード。
              example: US
            country_name:
              type: string
              description: '`country_code`から導出された国の正式名称。'
              example: United States
            carrier:
              type: object
              description: 番号を提供している現在のネットワーク。確定時に実行された通信事業者の照会結果に基づきます。
              properties:
                name:
                  type: string
                  description: 通信事業者名。照会で特定できなかった場合は空文字列です。
                type:
                  type: string
                  description: >-
                    ルックアップで報告された回線種別:
                    `mobile`、`fixed_line`、`voip`、`isp`、`vpn`、`toll_free`、`premium_rate`、`pager`、`payphone`、`satellite`、`service`、`shared_cost`、`short_codes_commercial`、`calling_cards`、`local_rate`、`universal_access`、`voice_mail`、`other`、または`unknown`。
            is_disposable:
              type: boolean
              description: 番号が一時/使い捨て番号サービスに属する場合は`true`です。
            is_virtual:
              type: boolean
              description: 回線種別が仮想（`voip`、`isp`、`vpn`のいずれか）の場合は`true`です。
            verification_method:
              type: string
              description: >-
                配信が確認された後は、実際にOTPを配信したチャネル（例:
                `whatsapp`、`sms`）です。それまではリクエストされたチャネルです。
            verification_attempts:
              type: integer
              description: この認証でOTPを送信した回数（1、または再試行後は2）。
            verified_at:
              type: string
              format: date-time
              nullable: true
              description: 正しいコードが入力された日時。認証が一度も承認されなかった場合は`null`。
            warnings:
              type: array
              description: 認証中に記録されたリスク警告(重複、使い捨て、VoIP、試行回数超過、ブロックリストなど)。該当がない場合は空の配列です。
              items:
                type: object
                properties:
                  feature:
                    type: string
                    description: 警告を生成した機能。ここでは常に`PHONE`です。
                  risk:
                    type: string
                    description: 機械可読なリスクコードです。
                  additional_data:
                    type: object
                    nullable: true
                    description: >-
                      リスク固有のコンテキスト(例:
                      重複リスクの場合は重複しているセッションID)。リスクに追加データがない場合は`null`です。
                  log_type:
                    type: string
                    enum:
                      - error
                      - warning
                      - information
                    description: >-
                      重大度。`error`のリスクは認証を却下し、`warning`はレビュー対象としてフラグを付け、`information`はステータスに影響を与えずに記録されます。
                  short_description:
                    type: string
                    description: リスクを人が読める形で1行にまとめた要約。
                  long_description:
                    type: string
                    description: リスクを人が読める形で説明したもの。
            lifecycle:
              type: array
              description: >-
                検証の監査証跡を時系列で示します。イベントの`type`は`PHONE_VERIFICATION_MESSAGE_SENT`、`PHONE_VERIFICATION_RETRY_MESSAGE_SENT`、`PHONE_VERIFICATION_BLOCKED`、`PHONE_DELIVERY_DELIVERED`、`PHONE_DELIVERY_UNDELIVERABLE`、`VALID_CODE_ENTERED`、`INVALID_CODE_ENTERED`、`PHONE_VERIFICATION_APPROVED`、`PHONE_VERIFICATION_DECLINED`、`PHONE_VERIFICATION_IN_REVIEW`、`PHONE_VERIFICATION_EXPIRED`のいずれかです。
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: イベントタイプです。
                  timestamp:
                    type: string
                    format: date-time
                    description: イベントが発生した日時。
                  details:
                    type: object
                    nullable: true
                    description: >-
                      イベント固有のペイロードです。送信イベント: `{status, reason, channel,
                      actual_channel}`(`actual_channel`は配信が確認されると設定されます)。配信イベント:
                      `{channel, status}`。コード入力イベント: `{code_tried,
                      status}`。最終ステータスイベント: `null`、または却下またはレビュー中の場合は`{reason}`。
                  fee:
                    type: number
                    description: >-
                      このイベントで請求されたUSD金額。送信イベント(配信料金)でのみゼロ以外の値になり、コード入力、配信確認、ステータスイベントでは0です。
            matches:
              type: array
              description: >-
                同じ電話番号が別のユーザー（異なる`vendor_data`）によって使用された、アプリケーション内の他のセッション（KYC、KYB、またはAPI）。最大5件で、リストエントリに基づく合成的なブロックリスト一致がある場合はそれが先頭に置かれます（セッション由来の一致はクエリの順序を維持します）。一致がない場合は空の配列です。
              items:
                type: object
                properties:
                  session_id:
                    type: string
                    format: uuid
                    description: この電話番号を使用した他の認証のセッションID。
                  session_number:
                    type: integer
                    description: そのセッションのわかりやすい連番。
                  vendor_data:
                    type: string
                    nullable: true
                    description: そのセッションの`vendor_data`です。
                  verification_date:
                    type: string
                    description: そのセッションが作成された日時（`YYYY-MM-DDTHH:MM:SSZ`）。
                  phone_number:
                    type: string
                    description: 一致した電話番号です。
                  status:
                    type: string
                    description: そのセッションのステータス（例：`Approved`、`Declined`、`In Progress`）。
                  is_blocklisted:
                    type: boolean
                    description: 電話番号がアプリケーションのブロックリストに登録されているかどうか。
                  api_service:
                    type: string
                    nullable: true
                    description: >-
                      APIタイプのセッションの場合、そのセッションを作成したスタンドアロンAPI（例：`PHONE_VERIFICATION`）。通常の認証セッションでは`null`です。
                  source:
                    type: string
                    description: >-
                      一致が見つかった場所です。通常は`session`です。組織のリストエントリ経由のブロックリスト一致では、`source:
                      "list_entry"`で`session_id`/`session_number`がnullの合成された一致が先頭に追加されます。
            phone_social:
              $ref: '#/components/schemas/PhoneSocialFootprint'
            phone_intelligence:
              allOf:
                - $ref: '#/components/schemas/PhoneIntelligence'
              description: 電話番号インテリジェンスのシグナル。チェックで`enable_enrichment`が`true`だった場合にのみ含まれます。
        vendor_data:
          type: string
          nullable: true
          description: 一致した認証のセッションの`vendor_data`です。`Expired or Not Found`の場合は`null`です。
        metadata:
          type: object
          nullable: true
          description: 一致した認証のセッションの`metadata`。`Expired or Not Found`の場合は`null`。
        created_at:
          type: string
          format: date-time
          description: このチェックレスポンスの日時。
    PhoneSocialFootprint:
      type: object
      nullable: true
      description: >-
        電話番号のソーシャルフットプリント:
        その電話番号が登録されているオンラインプラットフォームです。`enable_social`が設定され、チェックが完了した場合にのみ含まれます。データが返されなかった項目の件数は、いずれもnullになる場合があります。`profiles_registered:
        0`は、プラットフォームがチェックされ、そのいずれにも電話番号が見つからなかったことを意味します。これは有効かつ課金対象の結果であり、合成IDによく見られる兆候です。
      properties:
        profiles_registered:
          type: integer
          nullable: true
          description: 電話番号の登録が確認されたプラットフォーム。
          example: 5
        profiles_checked:
          type: integer
          nullable: true
          description: 登録状況を評価したプラットフォーム。
          example: 14
        names_found:
          type: integer
          nullable: true
          description: 関連付けられた名前を返したプラットフォーム。
          example: 0
        photos_found:
          type: integer
          nullable: true
          description: プロフィール写真を返したプラットフォーム。
          example: 0
        communication_breadth:
          type: integer
          nullable: true
          description: 存在が検出されたコミュニケーションプラットフォーム。
          example: 2
        digital_footprint_diversity:
          type: integer
          nullable: true
          description: 存在が検出された個別のプラットフォームカテゴリ。
          example: 5
        digital_sophistication_index:
          type: integer
          nullable: true
          description: デジタル成熟度の総合指標（0-10）。
          example: 5
        engagement_depth_index:
          type: integer
          nullable: true
          description: プロフィールの充実度を示す指標(0-10)。
          example: 3
        subscription_affordability_index:
          type: integer
          nullable: true
          description: 無料プラットフォームと有料プラットフォームの構成比（0-10）。
          example: 2
        free_platforms:
          type: integer
          nullable: true
          description: 無料プラットフォームでの登録。
          example: 4
        full_paid_platforms:
          type: integer
          nullable: true
          description: 完全有料プラットフォームでの登録。
          example: 0
        partial_paid_platforms:
          type: integer
          nullable: true
          description: フリーミアムプラットフォームでの登録。
          example: 1
        whatsapp_profile_completeness:
          type: string
          nullable: true
          enum:
            - Basic
            - Partial
            - Complete
            - Not Present
            - null
          description: WhatsAppプロフィールの充実度。電話番号のみ対象で、メールアドレスの場合はnullです。
          example: Partial
        registered_platforms:
          type: array
          description: 登録が確認されたプラットフォーム。
          items:
            $ref: '#/components/schemas/SocialFootprintPlatform'
        not_registered_platforms:
          type: array
          description: 確認の結果、否定的な結果となったプラットフォーム。
          items:
            $ref: '#/components/schemas/SocialFootprintPlatform'
        categories:
          type: object
          description: プラットフォームカテゴリごとの登録数と割合。
          additionalProperties:
            $ref: '#/components/schemas/SocialFootprintCategorySummary'
        profiles:
          type: object
          description: プラットフォームが公開している場合の、プラットフォームごとのプロフィール詳細です。プラットフォームをキーとします。
          additionalProperties:
            $ref: '#/components/schemas/SocialFootprintProfile'
    PhoneIntelligence:
      type: object
      description: >-
        正規化された電話番号インテリジェンスブロック。この照会に対してインテリジェンスアドオンが実行された場合にのみ存在します。存在する場合は、同一の値を持つ`enrichment`エイリアスでも公開されます。
      properties:
        score:
          type: number
          nullable: true
          description: 0-100に正規化されたリスクスコア。値が高いほどリスクが高くなります。
        phone_type_risk:
          type: string
          nullable: true
          description: スコアから算出される`Low`、`Medium`、`High`のいずれかです。
        phone_trust_index:
          type: number
          nullable: true
          description: スコアの逆数です。値が高いほど良いことを示すダッシュボード向けです。
        network_stability_index:
          type: number
          nullable: true
          description: 回線のネットワークの安定性。
        is_disposable:
          type: boolean
          nullable: true
          description: 番号が使い捨てまたは仮想番号と見られる場合は`true`です。
        is_ported:
          type: boolean
          nullable: true
          description: 番号の通信事業者が変更されている場合は`true`です。
        is_recently_ported:
          type: boolean
          nullable: true
          description: 番号ポータビリティが最近行われた場合は`true`です。
        carrier_type:
          type: string
          nullable: true
          description: 'ルックアップで報告された回線の分類（例: `mobile`）。'
        reason_codes:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: >-
                  シグナルの不変のDidit識別子。例:
                  `IR-5AC67A32`。不透明な値のため、グループ化やフィルターには使用できますが、解析はしないでください。
              value:
                nullable: true
                description: >-
                  リスクフラグ（例：`voip`、`leaked`、`disposable`、`spam_trap`）の場合、その値です：真偽値、レベル、または日付。スコア付きの理由コードではnullです。
              direction:
                type: string
                enum:
                  - risk
                  - trust
                description: シグナルがリスクを高めたか、信頼を加えたか。
              message:
                type: string
                description: シグナルを人が読める形で説明したもの（英語）。
              impact_level:
                type: string
                nullable: true
                description: シグナルがスコアに与えた影響の強さ。例：`low`、`medium`、`high`。
          description: >-
            スコアの根拠となるシグナル。それぞれに安定したDiditコード、方向、メッセージ、影響度があります。新しいコードが今後追加される可能性があるため、未知のコードを拒否しないでください。
    SocialFootprintPlatform:
      type: object
      properties:
        platform:
          type: string
          description: プラットフォーム識別子。
          example: whatsapp
        category:
          type: string
          description: >-
            プラットフォームのカテゴリー。例:
            MESSAGING、SOCIAL_MEDIA、ECOMMERCE、PROFESSIONAL、EMAIL_PROVIDER。
          example: MESSAGING
        scope:
          type: string
          enum:
            - global
            - local
          description: グローバルなプラットフォームの場合は`global`、地域限定のプラットフォームの場合は`local`。
          example: global
    SocialFootprintCategorySummary:
      type: object
      properties:
        registered:
          type: integer
          nullable: true
          description: このカテゴリーのうち、登録が確認されたプラットフォーム。
          example: 2
        ratio:
          type: number
          format: float
          nullable: true
          description: そのカテゴリでチェックしたプラットフォームのうち、登録があるものの割合（0.0〜1.0）。
          example: 0.6667
    SocialFootprintProfile:
      type: object
      properties:
        name:
          type: string
          nullable: true
          description: プロフィール名。プラットフォームが公開している場合に返されます。
        photo:
          type: string
          nullable: true
          description: プロフィール写真のURL。プラットフォームが公開している場合に返されます。
        about:
          type: string
          nullable: true
          description: プロフィールの自己紹介文。プラットフォームが公開している場合に返されます。
        privacy_status:
          type: string
          nullable: true
          enum:
            - PUBLIC
            - PRIVATE
            - null
          description: プロフィールの公開設定。プラットフォームが公開している場合に返されます。
        business_account:
          type: boolean
          nullable: true
          description: プラットフォームが公開している場合、プロフィールがビジネスアカウントかどうか。
  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.