mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-04 23:17:34 +08:00
docs: fix user API auth and add admin delete API docs (#836)
This commit is contained in:
@@ -42,6 +42,74 @@ 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 Delete Mail API
|
||||
|
||||
Delete a single mail by mail ID.
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
mail_id = 1
|
||||
url = f"https://<your-worker-address>/admin/mails/{mail_id}"
|
||||
|
||||
headers = {"x-admin-auth": "<your-Admin-password>"}
|
||||
|
||||
response = requests.delete(url, headers=headers)
|
||||
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
## Admin Delete Address API
|
||||
|
||||
Delete an email address by address ID (also deletes associated mails, sender permissions, and user bindings).
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
address_id = 1
|
||||
url = f"https://<your-worker-address>/admin/delete_address/{address_id}"
|
||||
|
||||
headers = {"x-admin-auth": "<your-Admin-password>"}
|
||||
|
||||
response = requests.delete(url, headers=headers)
|
||||
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
## Admin Clear Inbox API
|
||||
|
||||
Clear all received mails for an address by address ID.
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
address_id = 1
|
||||
url = f"https://<your-worker-address>/admin/clear_inbox/{address_id}"
|
||||
|
||||
headers = {"x-admin-auth": "<your-Admin-password>"}
|
||||
|
||||
response = requests.delete(url, headers=headers)
|
||||
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
## Admin Clear Sent Items API
|
||||
|
||||
Clear all sent mails for an address by address ID.
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
address_id = 1
|
||||
url = f"https://<your-worker-address>/admin/clear_sent_items/{address_id}"
|
||||
|
||||
headers = {"x-admin-auth": "<your-Admin-password>"}
|
||||
|
||||
response = requests.delete(url, headers=headers)
|
||||
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
## User Mail API
|
||||
|
||||
Supports `address` filter
|
||||
@@ -58,7 +126,7 @@ querystring = {
|
||||
"address":"xxxx@awsl.uk"
|
||||
}
|
||||
|
||||
headers = {"x-admin-auth": "<your-Admin-password>"}
|
||||
headers = {"x-user-token": "<your-user-JWT-token>"}
|
||||
|
||||
response = requests.get(url, headers=headers, params=querystring)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user