API Docs
REST + WebSocket API cho tempmail. Base URL được nhúng vào frontend lúc build.
https://temp.destiny-mmo.compublicPublic API
/api/domainsLiệt kê domain đã xác minh, hiển thị với IP của bạn (IP-gated).
Response
[
{ "domain": "mail.example.com", "verified": true, "addedAt": "...", "mxVerifiedAt": "..." }
]/api/domains?all=1Liệt kê tất cả domain (verified + pending). Công khai.
Response
[
{ "domain": "mail.example.com", "verified": false, "allowedIPs": [] }
]/api/domains/{domain}Chi tiết một domain.
Response
{ "domain": "mail.example.com", "verified": true }/api/domainsThêm domain mới (chưa xác minh).
Request body
{ "domain": "mail.example.com" }Response
{ "status": "added" }/api/domains/{domain}/verifyKiểm tra MX của domain trỏ tới server. Trả verified true/false.
Response
{ "verified": true }/api/inboxesTạo inbox. localpart để trống = ngẫu nhiên. Domain phải verified + hiển thị với IP của bạn.
Request body
{ "localpart": "john", "domain": "mail.example.com" }Response
{ "address": "john@mail.example.com" }/api/inboxes/{address}/emailsLiệt kê email trong inbox (tối đa 50, không kèm body/attachments).
Response
[
{ "id": "abc", "inboxAddress": "john@...", "from": "...", "to": "...", "subject": "...", "receivedAt": "..." }
]/api/emails/{id}Lấy toàn bộ nội dung một email (text, html, attachments base64).
Response
{ "id": "...", "text": "...", "html": "...", "attachments": [{ "filename": "...", "contentType": "...", "encoding": "base64", "data": "..." }] }/api/inboxes/{address}Xoá toàn bộ email trong inbox.
Response
{ "status": "cleared" }/api/ws/{address}WebSocket realtime — server đẩy TextMessage (JSON email) khi inbox nhận được mail mới. Ping mỗi 30s.
Response
wss://temp.destiny-mmo.com/api/ws/{address}
→ server push: { "id": "...", "subject": "...", ... }admin_panel_settingsAdmin API
Yêu cầu cookie session từ POST /admin/login. Tất cả endpoint dưới đây đều cần xác thực.
/admin/loginĐăng nhập admin. Trả cookie session (HttpOnly, 24h).
Request body
{ "password": "..." }Response
{ "status": "ok" }/admin/logoutĐăng xuất, xoá cookie session.
Response
{ "status": "ok" }/admin/domains🔒 adminLiệt kê tất cả domain (yêu cầu session admin).
Response
[ { "domain": "...", "verified": true, "allowedIPs": ["1.2.3.4"] } ]/admin/domains🔒 adminThêm domain (yêu cầu session admin).
Request body
{ "domain": "mail.example.com" }Response
{ "status": "added" }/admin/domains/{domain}/verify🔒 adminXác minh MX (admin, ép buộc).
Response
{ "verified": true }/admin/domains/{domain}/ips🔒 adminĐặt danh sách IP được phép dùng domain (riêng tư). Để trống = công khai.
Request body
{ "ips": ["1.2.3.4", "5.6.7.8"] }Response
{ "status": "updated", "ips": ["1.2.3.4"] }/admin/domains/{domain}🔒 adminXoá domain.
Response
{ "status": "deleted" }/admin/inboxes🔒 adminLiệt kê toàn bộ inbox.
Response
[ { "address": "...", "domain": "...", "createdAt": "...", "expiresAt": "..." } ]/admin/inboxes/{address}/emails🔒 adminLiệt kê email trong inbox (admin, đầy đủ).
Response
[ { "id": "...", "subject": "...", ... } ]/admin/inboxes/{address}🔒 adminXoá inbox và toàn bộ email.
Response
{ "status": "deleted" }Lưu ý
- • IP-gating: các lệnh đọc inbox/email/WS bị chặn nếu domain là riêng tư (allowedIPs) và IP của bạn không nằm trong danh sách.
- • Email hết hạn sau 24 giờ. Inbox tồn tại cho đến khi xoá thủ công.
- • SMTP nhận mail trên port 25 — MX của mail domain phải trỏ tới
temp.destiny-mmo.com. - • CORS: backend gửi
Access-Control-Allow-OrigintheoAPI_ORIGIN, cho phép credentials.