docs: add delete-address api docs (#936)

This commit is contained in:
Dream Hunter
2026-04-04 18:33:56 +08:00
committed by GitHub
parent 1a7cfb8c95
commit 53c35062c8
4 changed files with 86 additions and 0 deletions

View File

@@ -166,6 +166,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
{ text: 'New Address API', link: 'feature/new-address-api' },
{ text: 'View Email API', link: 'feature/mail-api' },
{ text: 'Send Email API', link: 'feature/send-mail-api' },
{ text: 'Delete Address API', link: 'feature/delete-address' },
]
},
{

View File

@@ -166,6 +166,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
{ text: '新建邮箱地址 API', link: 'feature/new-address-api' },
{ text: '查看邮件 API', link: 'feature/mail-api' },
{ text: '发送邮件 API', link: 'feature/send-mail-api' },
{ text: '删除邮箱地址 API', link: 'feature/delete-address' },
]
},
{

View File

@@ -0,0 +1,42 @@
# Delete Address API
## Admin Delete Address API
Delete an address by address ID. This endpoint requires admin auth and deletes related data (mails, sender settings, bindings, etc.).
```bash
DELETE /admin/delete_address/:id
```
Header:
- `x-admin-auth: <admin_password>`
Example response:
```json
{ "success": true }
```
## User Delete Address API
Delete mailbox by address JWT. The request needs address token permission and deletes related data (received mails, sent items, auto reply data, sender bindings, user bindings, telegram bind records).
```bash
DELETE /api/delete_address
```
Headers:
- `Authorization: Bearer <address_jwt>`
Notes:
- `ENABLE_USER_DELETE_EMAIL` must be enabled.
- Address credential can be obtained from `/api/new_address` or `/admin/new_address`.
Example response:
```json
{ "success": true }
```

View File

@@ -0,0 +1,42 @@
# 删除邮箱地址 API
## 管理员删除地址 API
使用地址 ID 删除邮箱地址。该接口需要管理员鉴权,并会同时清理关联数据(收件、发件来源授权、用户绑定等)。
```bash
DELETE /admin/delete_address/:id
```
请求头:
- `x-admin-auth: <admin_password>`
返回示例:
```json
{ "success": true }
```
## 普通地址删除 API
使用地址 JWT 删除当前邮箱。该接口会清理关联数据收件、发件、自动回复、sender 绑定、用户绑定、Telegram 绑定等)。
```bash
DELETE /api/delete_address
```
请求头:
- `Authorization: Bearer <address_jwt>`
说明:
- 需开启 `ENABLE_USER_DELETE_EMAIL = true`
- 地址凭证来自 `/api/new_address``/admin/new_address`
返回示例:
```json
{ "success": true }
```