API-Dokumentation
TempMail API v1 Referenz
Basis-URL
https://mail.taohuaxin.topAuthentifizierung
Alle Endpunkte außer /config erfordern Authentifizierung.
Füge den folgenden Header zu allen Anfragen hinzu:
x-api-key: tm_your_token_hereToken erhalten: Dashboard → Einstellungen → API-Schlüssel
Endpunkte
| Methode | Pfad | Beschreibung |
|---|---|---|
| GET | /api/v1/config | Serverkonfiguration (öffentlich — keine Authentifizierung erforderlich) |
| GET | /api/v1/me | E-Mails aus allen Postfächern abrufen (Long Poll) |
| GET | /api/v1/inbox/:address | E-Mails für ein einzelnes Postfach abrufen (Long Poll) |
| DELETE | /api/v1/inbox/:address | Alle E-Mails in einem Postfach löschen |
| GET | /api/v1/email/:id | Vollständig geparste E-Mail abrufen (Text + HTML + Anhänge) |
| GET | /api/v1/email/:id/rendered | Gerenderten E-Mail-Text abrufen |
| GET | /api/v1/email/:id/attachments/:attachmentId | Einen Anhang nach ID herunterladen |
| DELETE | /api/v1/email/:id | Einzelne E-Mail löschen |
| GET | /api/v1/domains | Eigene Domains auflisten |
| POST | /api/v1/domains | Eigene Domain hinzufügen |
| DELETE | /api/v1/domains/:id | Eigene Domain entfernen |
docs.examples
/api/v1/configServerkonfiguration (öffentlich — keine Authentifizierung erforderlich)
curl https://mail.taohuaxin.top/api/v1/configdocs.response
{
"domains": ["taohuaxin.top"],
"smtpPort": 25,
"smtpsPort": 465,
"mxPort": 25,
"version": "1.0.0"
}/api/v1/meE-Mails aus allen Postfächern abrufen (Long Poll)
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"
}/api/v1/inbox/:addressE-Mails für ein einzelnes Postfach abrufen (Long Poll)
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"
}/api/v1/inbox/:addressAlle E-Mails in einem Postfach löschen
curl -X DELETE -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/inbox/[email protected]"docs.response
{ "success": true }/api/v1/email/:idVollständig geparste E-Mail abrufen (Text + HTML + Anhänge)
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 }
]
}/api/v1/email/:id/renderedGerenderten E-Mail-Text abrufen
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>/api/v1/email/:id/attachments/:attachmentIdEinen Anhang nach ID herunterladen
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>/api/v1/email/:idEinzelne E-Mail löschen
curl -X DELETE -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/email/cmcg2a1b40001xyz"docs.response
{ "success": true }/api/v1/domainsEigene Domains auflisten
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"
}
]/api/v1/domainsEigene Domain hinzufügen
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"
}/api/v1/domains/:idEigene Domain entfernen
curl -X DELETE -H "x-api-key: tm_your_token_here" \
"https://mail.taohuaxin.top/api/v1/domains/dom_02"docs.response
{ "success": true }Long Poll
Die Posteingangs-Endpunkte unterstützen Long-Polling. Einmal aufrufen und der Server blockiert, bis Post eintrifft (bis zu 25 s). Gibt 204 zurück, wenn keine Post vor Timeout eintrifft.
Abfrageparameter
| Parameter | Beschreibung |
|---|---|
| since | Cursor aus der vorherigen Antwort; nur E-Mails nach diesem Zeitpunkt werden zurückgegeben |
| count | Zurückgeben, sobald N neue E-Mails eingetroffen sind (Standard 1, max. 50) |
| limit | Maximale E-Mails pro Antworttext (Standard 20, max. 50) |
| from | Filter — nur E-Mails zurückgeben, deren Absender diese Zeichenkette enthält |
| subject | Filter — nur E-Mails zurückgeben, deren Betreff diese Zeichenkette enthält |
Löschverhalten
Alle DELETE-Operationen sind Soft Deletes: Gelöschte Elemente sind für Benutzer unsichtbar, bleiben aber für Administratoren zu Prüfzwecken zugänglich.