mirror of
https://github.com/Crazyco-xyz/48hr.email.git
synced 2026-01-09 11:19:36 +01:00
1.3 KiB
1.3 KiB
Mail Operations API
Overview
Endpoints for deleting emails and forwarding mail.
Endpoints
DELETE /api/v1/mail/inbox/:address/:uid
Delete a single email by UID.
- Auth: Optional
- Response:
- Success message
- Errors:
VALIDATION_ERROR,NOT_FOUND
DELETE /api/v1/mail/inbox/:address
Delete all emails in an inbox (requires ?confirm=true).
- Auth: Optional
- Response:
- Success message, deleted count
- Errors:
CONFIRMATION_REQUIRED,NOT_FOUND
POST /api/v1/mail/forward
Forward a single email.
- Auth: Required
- Body:
address,uid,to
- Response:
- Success message
- Errors:
VALIDATION_ERROR,NOT_FOUND,FORWARD_FAILED
POST /api/v1/mail/forward-all
Forward all emails in an inbox.
- Auth: Required
- Body:
address,to
- Response:
- Success message
- Errors:
VALIDATION_ERROR,NOT_FOUND,FORWARD_FAILED
Response Format
{
success: true|false,
data: ...,
error?: ...,
code?: ...
}
Error Codes
VALIDATION_ERROR: Invalid inputNOT_FOUND: Resource not foundCONFIRMATION_REQUIRED: Confirmation required for bulk deleteFORWARD_FAILED: Forwarding failed
Example Response
{
"success": true,
"data": {
"message": "Email deleted successfully"
}
}