feat: add admin mail detail API (#1099)

* feat: add admin mail detail API

* docs: clarify admin mail detail response
This commit is contained in:
Dream Hunter
2026-07-31 15:36:00 +08:00
committed by GitHub
parent 2dcbad40ad
commit 116ddc7324
8 changed files with 127 additions and 0 deletions
@@ -49,6 +49,27 @@ print(response.json())
**Note**: Keyword filtering has been removed from the backend API. If you need to filter emails by content, please use the frontend filter input in the UI, which filters the currently displayed page.
## Admin Get Mail API
Fetch a single mail by mail ID without a mailbox JWT. Authenticate with `x-admin-auth`.
The response matches one entry returned by `/admin/mails`: gzip-compressed raw content is decompressed into `raw`, and `raw_blob` is excluded.
```python
import requests
mail_id = 1
url = f"https://<your-worker-address>/admin/mails/{mail_id}"
headers = {
"x-admin-auth": "<your-Admin-password>",
# "x-custom-auth": "<your-website-password>", # If private site password is enabled
}
response = requests.get(url, headers=headers)
print(response.json())
```
## Admin Delete Mail API
Delete a single mail by mail ID.