TempMail

Dokumentasi API

Rujukan TempMail API v1

URL Asas

https://mail.taohuaxin.top

Pengesahan

Semua titik akhir kecuali /config memerlukan pengesahan.

Tambahkan pengepala berikut kepada semua permintaan:

x-api-key: tm_your_token_here

Dapatkan token anda di: Papan Pemuka → Tetapan → Kunci API

Titik Akhir

KaedahLaluanPenerangan
GET/api/v1/configKonfigurasi pelayan (awam — tiada pengesahan diperlukan)
GET/api/v1/meAmbil e-mel di semua peti mel anda (undian panjang)
GET/api/v1/inbox/:addressAmbil e-mel untuk satu peti mel (undian panjang)
DELETE/api/v1/inbox/:addressKosongkan semua e-mel dalam peti mel
GET/api/v1/email/:idDapatkan e-mel terhurai penuh (teks + html + lampiran)
GET/api/v1/email/:id/renderedDapatkan teks e-mel yang dipaparkan
GET/api/v1/email/:id/attachments/:attachmentIdMuat turun satu lampiran mengikut ID
DELETE/api/v1/email/:idPadam satu e-mel
GET/api/v1/domainsSenaraikan domain tersuai anda
POST/api/v1/domainsTambah domain tersuai
DELETE/api/v1/domains/:idBuang domain tersuai

docs.examples

GET/api/v1/config

Konfigurasi pelayan (awam — tiada pengesahan diperlukan)

curl https://mail.taohuaxin.top/api/v1/config

docs.response

{
  "domains": ["taohuaxin.top"],
  "smtpPort": 25,
  "smtpsPort": 465,
  "mxPort": 25,
  "version": "1.0.0"
}
GET/api/v1/me

Ambil e-mel di semua peti mel anda (undian panjang)

curl -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/me?count=1&limit=20"

docs.response

{
  "emails": [
    {
      "id": "cmcg2a1b40001xyz",
      "fromAddress": "[email protected]",
      "subject": "Your verification code",
      "isRead": false,
      "receivedAt": "2026-07-10T08:30:00.000Z",
      "mailbox": { "address": "alice", "domain": "taohuaxin.top" }
    }
  ],
  "nextSince": "cmcg2a1b40001xyz"
}
GET/api/v1/inbox/:address

Ambil e-mel untuk satu peti mel (undian panjang)

curl -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/inbox/[email protected]?since=cmcg2a1b40001xyz&count=1"

docs.response

{
  "emails": [
    {
      "id": "cmcg9f2c80002abc",
      "fromAddress": "[email protected]",
      "subject": "Welcome!",
      "isRead": false,
      "receivedAt": "2026-07-10T09:00:00.000Z"
    }
  ],
  "nextSince": "cmcg9f2c80002abc"
}
DELETE/api/v1/inbox/:address

Kosongkan semua e-mel dalam peti mel

curl -X DELETE -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/inbox/[email protected]"

docs.response

{ "success": true }
GET/api/v1/email/:id

Dapatkan e-mel terhurai penuh (teks + html + lampiran)

curl -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz"

docs.response

{
  "id": "cmcg2a1b40001xyz",
  "fromAddress": "[email protected]",
  "toAddress": "[email protected]",
  "subject": "Your verification code",
  "bodyHtml": "<p>Your code is <b>123456</b></p>",
  "bodyText": "Your code is 123456",
  "isRead": true,
  "receivedAt": "2026-07-10T08:30:00.000Z",
  "attachments": [
    { "id": "att_01", "filename": "invoice.pdf", "mimeType": "application/pdf", "size": 24580 }
  ]
}
GET/api/v1/email/:id/rendered

Dapatkan teks e-mel yang dipaparkan

curl -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz/rendered"

docs.response

From: [email protected]
To: [email protected]
Subject: Your verification code
Date: Fri, 10 Jul 2026 08:30:00 GMT

<p>Your code is <b>123456</b></p>
GET/api/v1/email/:id/attachments/:attachmentId

Muat turun satu lampiran mengikut ID

curl -OJ -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz/attachments/att_01"

docs.response

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="invoice.pdf"
Content-Length: 24580

<binary file stream>
DELETE/api/v1/email/:id

Padam satu e-mel

curl -X DELETE -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz"

docs.response

{ "success": true }
GET/api/v1/domains

Senaraikan domain tersuai anda

curl -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/domains"

docs.response

[
  {
    "id": "dom_01",
    "domain": "mail.example.com",
    "verified": true,
    "receiveMode": "inherit",
    "createdAt": "2026-07-01T00:00:00.000Z"
  }
]
POST/api/v1/domains

Tambah domain tersuai

curl -X POST -H "x-api-key: tm_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"domain":"mail.example.com","receiveMode":"inherit"}' \
  "https://mail.taohuaxin.top/api/v1/domains"

docs.response

{
  "id": "dom_02",
  "domain": "mail.example.com",
  "verified": false,
  "receiveMode": "inherit",
  "createdAt": "2026-07-10T10:00:00.000Z"
}
DELETE/api/v1/domains/:id

Buang domain tersuai

curl -X DELETE -H "x-api-key: tm_your_token_here" \
  "https://mail.taohuaxin.top/api/v1/domains/dom_02"

docs.response

{ "success": true }

Undian Panjang

Titik akhir peti mel menyokong undian panjang. Panggil sekali dan pelayan akan menyekat sehingga mel tiba (sehingga 25s). Mengembalikan 204 jika tiada mel tiba sebelum tamat masa.

Parameter Pertanyaan

ParameterPenerangan
sinceKursor daripada respons sebelumnya; hanya mel selepas ini dikembalikan
countKembalikan setelah N e-mel baharu tiba (lalai 1, maks 50)
limitMaksimum e-mel setiap badan respons (lalai 20, maks 50)
fromTapis — hanya kembalikan mel yang Daripadanya mengandungi subrentetan ini
subjectTapis — hanya kembalikan mel yang Subjeknya mengandungi subrentetan ini

Kelakuan Pemadaman

Semua operasi DELETE adalah pemadaman lembut: item yang dipadam disembunyikan daripada pengguna tetapi kekal boleh diakses oleh pentadbir untuk tujuan audit.