> ## 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：短信 OTP 与风险信号

> Didit 提供两步短信 OTP 验证，并可检测运营商、虚拟号码和一次性号码。按量计费：运营商价格加 $0.02 手续费，无需签约。

电话验证 API 提供两步流程：向电话号码发送一次性验证码，然后核验该验证码。系统可检测运营商类型、虚拟号码和一次性电话号码。

## 端点

> [card] [发送电话验证码](https://docs.didit.me/zh/standalone-apis/phone-send.md)
>
> `POST /v3/phone/send/`：通过短信发送一次性验证码。

> [card] [检查电话验证码](https://docs.didit.me/zh/standalone-apis/phone-check.md)
>
> `POST /v3/phone/check/`：核验验证码并获取电话风险数据。

> [card] [电话风险评分](https://docs.didit.me/zh/standalone-apis/phone-risk.md)
>
> `POST /v3/phone/risk/`：在不发送 OTP 的情况下，对运营商、线路类型、携号转网和欺诈风险进行评分。

## 工作原理

1. 调用 **Send Phone Code**，传入 E.164 格式的电话号码（例如 `+14155552671`）
2. 用户通过短信收到验证码（有效期为 5 分钟）
3. 调用 **Check Phone Code**，传入电话号码和验证码
4. 获取验证结果以及风险信号（运营商类型、虚拟号码检测）

## 投递渠道

Didit 支持多种渠道，具体取决于国家或地区的可用情况：

| 渠道 | 说明 |
| - | - |
| SMS | 标准短信 |
| WhatsApp | WhatsApp 消息 |
| Telegram | Telegram 消息 |
| RCS | 富通信服务（RCS） |
| Viber | Viber 消息 |

## 风险信号

| 信号 | 说明 |
| - | - |
| `is_disposable` | 临时或一次性电话号码 |
| `is_virtual` | VoIP 或虚拟号码 |
| `carrier.type` | `mobile`、`landline` 或 `voip` |

有关完整的响应结构，请参阅 [电话验证报告](https://docs.didit.me/zh/core-technology/phone-verification/overview.md)。

## 服务提供商故障

如果上游电话服务提供商未能响应发送或检查请求，两个端点都会返回 `502` 和 `code: "phone_provider_unavailable"`，而不是通用错误。此错误可以安全重试，不计费，也不会占用每个号码每小时上限中的一次尝试次数。请根据 `code` 进行分支处理，而不要解析 `detail` 消息，因为消息文本不是稳定的接口约定。


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