Files
mipu-open/docs/11-02_mailbox-domain-apply.md
杨柳杰 b450b512a2 init: mipu-open 对外开放项目统一管理仓库
- 添加 mipu-api 作为 git submodule (Claude Code Skill)
- 迁移 API 文档源文件到 docs/ 目录统一维护
- 添加 Gitea Actions 工作流:tag推送自动打包docs并发布Release
- Skill 运行时自动从 mipu-open Release 下载最新文档

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 12:16:08 +08:00

91 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- mipuyun-api-doc: mailbox-domain-apply -->
# mailbox/domain/apply - 申请绑定域名
# 申请绑定域名(mailbox/domain/apply) API 说明文档
## 使用场景
> 1. 企业客户需要为自己的邮箱系统绑定自定义域名
> 1. 配置企业邮箱后,员工可以使用 @company.com 格式的邮箱地址
## 错误场景(不应该使用本接口的场景)
> 1. 域名已被其他客户绑定
> 1. 域名格式不正确(如包含非法字符)
> 1. 客户已达到域名绑定数量上限
## 性能指标
> - 响应速度98% 的请求响应速度 < 1000ms
## 请求说明
| **请求地址** | https://${endpoint}/mailbox/domain/apply |
| --- | --- |
| **请求方法** | POST |
## 请求参数
### Header
| **参数名称** | **类型** | **是否必选** | **示例值** | **说明** |
| --- | --- | --- | --- | --- |
| Content-Type | String | 是 | application/json | 固定值,指定请求体格式为 JSON |
| Accept-Encoding | String | 是 | gzip, deflate, br | 必须要填写,否则服务器会拒绝 |
| client-key | String | 是 | xxxxx | 联系我们获取生产环境key |
| client-secret | String | 是 | xxxxx | 联系我们获取生产环境secret |
### 请求体
```json
{
"domainName": "example.com"
}
```
#### 参数详情
| **参数名称** | **类型** | **是否必选** | **示例值** | **说明** |
| --- | --- | --- | --- | --- |
| domainName | String | 是 | example.com | 要绑定的域名名称,必须是有效的域名格式 |
## 返回参数
| **参数名称** | **类型** | **示例值** | **说明** |
| --- | --- | --- | --- |
| domainId | Long | 123 | 域名唯一标识 |
| domainName | String | example.com | 域名名称 |
| status | String | PENDING | 域名状态PENDING=待DNS验证 |
| dnsVerified | Boolean | false | DNS验证状态新申请的域名需要验证 |
| createTime | String | 2025-01-02T10:00:00Z | 域名创建时间ISO 8601格式 |
## 返回示例
```json
{
"domainId": 123,
"domainName": "example.com",
"status": "PENDING",
"dnsVerified": false,
"createTime": "2025-01-02T10:00:00Z"
}
```
## 后续步骤
申请域名绑定后需要完成DNS验证才能激活邮箱服务
1. 在域名DNS管理中添加相应的MX记录
2. 调用 `mailbox/domain/verify` 接口验证DNS配置
3. 验证通过后,域名状态将变为 ACTIVE
## 错误码说明
| **错误码** | **说明** |
| --- | --- |
| 400 | 请求参数错误,域名格式不正确 |
| 401 | 认证失败client-key 或 client-secret 无效 |
| 409 | 域名已被其他客户绑定 |
| 429 | 已达到域名绑定数量上限 |
| 500 | 服务器内部错误 |