通过 HTTP 管理临时收件箱。基本网址: ...。 TinyMail 只接收电子邮件;它不发送它。
/api/all-domains/ 需要 X-Domain-Token 标头。
获取用户电子邮件的分页列表。列表响应仅包含元数据(无 body / html_body).
| 范围 | 地点 | 描述 |
|---|---|---|
domain | 小路 | 电子邮件域名,例如 example.com |
user | 小路 | 用户名,例如 testuser |
page | 查询,可选 | 页码(默认1) |
limit | 查询,可选 | 每页项目数(默认 20 个,最多 100 个) |
curl -X GET "https://BASE_URL/api/email/example.com/testuser/?page=1&limit=20"
{
"emails": [
{
"id": 123,
"subject": "Welcome",
"sender": "[email protected]",
"date": "2026-09-30T10:30:00.000Z",
"has_attachments": false,
"size": 1234
}
],
"total": 5,
"page": 1,
"limit": 20,
"has_more": false
}
获取电子邮件的完整详细信息。
curl -X GET "https://BASE_URL/api/email/example.com/testuser/123"
删除特定电子邮件。
curl -X DELETE "https://BASE_URL/api/email/example.com/testuser/123"
{ "status": "deleted" }
添加新域或更新现有域的在线状态。该域必须有一条 MX 记录指向要接受的系统主机名(状态 added, is_online: true).
curl -X POST "https://BASE_URL/api/add-domain/newdomain.com"
// 添加成功
{ "status": "added", "domain": "newdomain.com", "is_online": true }
// 现有域:更新其状态
{ "status": "updated", "domain": "newdomain.com", "is_online": false }
所有在线域(私有,需要令牌):
curl -X GET "https://BASE_URL/api/all-domains/" \
-H "X-Domain-Token: YOUR_TOKEN"
随机在线域(公共):
curl -X GET "https://BASE_URL/api/random-domains/?limit=10"
{ "domains": ["domain1.com", "domain2.com"], "total": 2 }
检查域是否有指向系统的有效 MX 记录。
curl -X GET "https://BASE_URL/api/check-mx/example.com"
{ "result": "online" } // 或者 "offline"
| 代码 | 意义 |
|---|---|
| 200 | 成功 |
| 400 | 无效请求(例如格式错误的域名/电子邮件) |
| 401 | 专用端点的令牌丢失或无效 |
| 404 | 未找到电子邮件 |
| 429 | 超出速率限制 |
{ "detail": "Domain not found" }
[email protected]