> ## 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，无月度最低消费要求。

Didit 的邮箱验证提供了一种可靠的方法，通过一次性验证码（OTP）和高级风险评估来验证用户的电子邮件地址。该功能有助于确保联系信息的有效性和可达性，同时防范高风险邮箱和已遭入侵的邮箱。

邮箱验证集成提示词
        将提示词复制到剪贴板



      
      

\<pre>

\````# Goal
Integrate Didit Email Verification (OTP send + check + deliverability / breach / disposable lookup) into your app. Pick ONE mode.

\# Mode A — Session-based
Use this when the user completes verification through a hosted Didit flow.

1\. Add the EMAIL feature to the workflow (Business Console or POST /v3/workflows/). Configure risk actions: duplicated_email_action, breached_email_action, disposable_email_action.
2\. Create a session — POST /v3/session/ with { workflow_id, vendor_data, callback }. See /sessions-api/create-session.
3\. Open session.url for the user (or mount the Web/Mobile SDK).
4\. Fetch the decision — GET /v3/session/{sessionId}/decision/ or subscribe to session.status.updated.

Decision surface: `email_verifications[]` array on the decision payload.

\# Mode B — Standalone API (server-to-server, OTP pair)
Two endpoints paired by email address.

Step 1 — send the code:
\```bash
curl -X POST 'https://verification.didit.me/v3/email/send/' \
-H "x-api-key: $DIDIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@example.com",
"options": { "code_size": 6, "locale": "en", "use_white_label_customization": false },
"vendor_data": "user-1234"
}'
\```
Default: 6 numeric digits and Didit-branded delivery. Set `options.alphanumeric_code: true` for letters+digits (check is case-insensitive). Set `options.use_white_label_customization: true` to use your application's configured white-label sender and branding for this standalone OTP email; the default is `false`. `options.code_size` 4–8. Codes expire in **5 minutes**; one free retry per email within the window.

Step 2 — check the code (user types it into your UI):
\```bash
curl -X POST 'https://verification.didit.me/v3/email/check/' \
-H "x-api-key: $DIDIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@example.com",
"code": "123456",
"disposable_email_action": "DECLINE"
}'
\```
Each session accepts **up to 3** code-entry attempts. The check response always includes the full email metadata (breaches[], disposable flag, deliverable flag).

\# Status enum (per email_verifications[].status / email.status)
"Not Started" | "In Progress" | "Approved" | "Declined" | "Failed" | "Undeliverable" | "Expired or Not Found" | "Abandoned" | "Kyc Expired"

\# Warnings (LogWarningChoices.EMAIL)
warnings[] risk codes include:
DUPLICATED_EMAIL, BREACHED_EMAIL, DISPOSABLE_EMAIL, UNDELIVERABLE_EMAIL, INVALID_EMAIL, OTP_MAX_ATTEMPTS_REACHED, OTP_EXPIRED.
Full catalogue: /core-technology/email-verification/warnings-email-verification.

\# Failure modes to handle
\- send response status="Undeliverable" — bounce/invalid domain; no charge, surface to the user.
\- check response status="Failed" — wrong code, attempts remaining; re-prompt.
\- check response status="Declined" — third failed attempt; restart with /v3/email/send/.
\- check response status="Expired or Not Found" — outside the 5-minute window; restart.
\- BREACHED_EMAIL warning — the address appears in known breaches; route to review per policy.

\# See also
\- Canonical schema: /reference/data-models#email-verification
\- Per-feature report: /core-technology/email-verification/report-email-verification
\- Risk catalogue: /core-technology/email-verification/warnings-email-verification
\- Full integration playbook: /integration/integration-prompt````

\</pre>



      
      

粘贴到

关于解读验证结果的 Academy 课程在 8:34 处介绍了邮箱验证检查。[邮箱验证 — Didit Academy](https://www.youtube.com/embed/7htTWCWsl60?start=514\&rel=0\&playsinline=1)![邮箱验证流程图](https://mintcdn.com/didit-0f962782/z6T2GHM4Zh-iSj-K/images/email-verification-flow.png?fit=max\&auto=format\&n=z6T2GHM4Zh-iSj-K\&q=85\&s=23d035a261faa2063d6d941290ecf752)## 工作原理我们的邮箱验证解决方案将 OTP 验证与数据泄露暴露、可投递性以及服务商信誉等情报信号相结合。**1. 邮箱收集**系统安全地收集：| 输入 | 描述 |
| - | - |
| **电子邮件地址** | 如果在创建会话时未提供，用户需输入其电子邮件地址。如果在创建会话时已提供，用户必须验证预先填写的邮箱。 |
| **首选语言** | 适用时用于本地化沟通。 |**2. OTP 生成与投递**我们的验证系统：- 生成安全且有时限的一次性验证码
- 通过电子邮件将验证码投递至所提供的地址
- 采用投递最佳实践以最大化收件箱送达率
- 提供带有防滥用保护措施的重新发送流程**3. 验证码核验**用户通过以下操作完成验证：- 在验证界面中输入收到的验证码
- 在配置的时限内提交（5 分钟）
- 需要时请求新验证码（带有适当的速率限制）**4. 风险评估**我们的系统执行高级检查：| 检查 | 描述 |
| - | - |
| **数据泄露暴露** | 在已知的数据泄露记录中查询该邮箱，并列出暴露的服务。 |
| **临时邮箱服务商检测** | 标记来自临时/一次性服务商的邮箱。 |
| **可投递性检查** | 检测无法投递或语法无效的地址。 |
| **信誉信号** | 识别潜在的高风险邮箱模式。 |
| **重复使用** | 与历史验证数据进行交叉比对。 |**5. 结果投递**通过多种渠道获取验证结果：| 渠道 | 描述 |
| - | - |
| **仪表板** | 实时仪表板更新。 |
| **Webhook** | Webhook 通知。 |
| **API** | RESTful API 响应。 |
| **报告** | 包含详细验证信息的综合报告。 |## 验证功能我们的邮箱验证服务提供多项核心功能，以增强您的验证流程：#### OTP 验证- **安全验证码生成**：随机且具有时效性的一次性验证码
- **邮件投递**：可靠且本地化的邮件投递
- **可配置的超时时间**：根据您的安全要求设置过期时间
- **重试选项**：允许用户在合理限制内请求新验证码#### 邮箱分析- **语法验证**：确保电子邮件地址符合 RFC 规范格式
- **服务商检查**：识别一次性/临时邮箱服务商
- **可投递性分析**：检测无法投递的地址
- **数据泄露情报**：展示已知的泄露记录及其详细信息#### 风险评估- **暴露检测**：识别邮箱是否出现在已知泄露事件中
- **临时邮箱检测**：标记临时或一次性邮箱
- **活动监控**：跨多次尝试跟踪可疑模式
- **黑名单核对**：对照既往被滥用邮箱的内部名单进行核对


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