REST API để tích hợp TempMail vào ứng dụng của bạn. Không cần xác thực — hoàn toàn miễn phí.
JSON{ "domains": ["hungsmoke.site", "example.com"] }
cURLcurl
| Field | Type | Required | Description |
|---|---|---|---|
| domain | string | required | Domain muốn thêm, ví dụ yourdomain.com |
JSON{ "ok": true, "domain": "yourdomain.com", "mx": [{ "priority": 10, "exchange": "mail.yourserver.com" }], "warning": null }
JSON{ "error": "mx_not_found", "message": "Không tìm thấy MX record cho yourdomain.com", "guide": { "type": "MX", "host": "@", "value": "1.2.3.4", "priority": 10, "ttl": 300 } }
JSON{ "address": "happyfox1234@hungsmoke.site", "expiresAt": 0, "ttl": 0 }
| Field | Type | Required | Description |
|---|---|---|---|
| username | string | required | 1-40 ký tự, chỉ dùng a-z 0-9 . _ - |
| domain | string | required | Phải là domain có trong hệ thống |
JSON{ "address": "myname@hungsmoke.site", "expiresAt": 0, "ttl": 0 }
| Param | Type | Description |
|---|---|---|
| address | string | Địa chỉ email đầy đủ, ví dụ foo@hungsmoke.site |
JSON{ "messages": [ { "id": "uuid-v4", "receivedAt": "2026-03-29T10:00:00.000Z", "from": "sender@example.com", "to": "foo@hungsmoke.site", "subject": "Hello World", "text": "Nội dung thuần văn bản", "html": "<p>Nội dung HTML</p>", "attachments": [] } ], "expiresAt": 0 }
| Param | Type | Description |
|---|---|---|
| address | string | Địa chỉ email |
| id | string | UUID của mail (lấy từ inbox) |
JSON// Trả về object mail giống như trong mảng messages { "id": "...", "subject": "...", // ... đầy đủ các field }
| Param | Type | Description |
|---|---|---|
| address | string | Địa chỉ email cần xoá |
JSON{ "ok": true }
JSON{ "totalMails": 1024 }
Kết nối WebSocket để nhận mail realtime thay vì polling. Server sẽ push ngay khi có mail mới.
JSON{ "type": "subscribe", "address": "foo@hungsmoke.site" }
JSON{ "type": "inbox", "messages": [ /* array mail objects */ ], "expiresAt": 0 }
JSON{ "type": "new_mail", "message": { /* mail object */ } }
JSconst ws = new WebSocket('wss://hungsmoke.site'); ws.onopen = () => ws.send(JSON.stringify({ type: 'subscribe', address: 'foo@hungsmoke.site' })); ws.onmessage = (e) => { const msg = JSON.parse(e.data); if (msg.type === 'new_mail') { console.log('📨 New mail:', msg.message.subject); } };